/*! Sdm Main V2 - v0.1.0 - * Copyright (c) 2022 Trapeze; */function X2JS(a){"use strict";function b(){void 0===a.escapeMode&&(a.escapeMode=!0),void 0===a.attributePrefix&&(a.attributePrefix="_"),void 0===a.arrayAccessForm&&(a.arrayAccessForm="none"),void 0===a.emptyNodeForm&&(a.emptyNodeForm="text")}function c(a){var b=a.localName;return null==b&&(b=a.baseName),null!=b&&""!=b||(b=a.nodeName),b}function d(a){return a.prefix}function e(a){return"string"==typeof a?a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"):a}function f(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(///g,"/")}function g(b,c){switch(a.arrayAccessForm){case"property":b[c]instanceof Array?b[c+"_asArray"]=b[c]:b[c+"_asArray"]=[b[c]]}}function h(b){if(b.nodeType==t.DOCUMENT_NODE){var e=new Object,i=b.firstChild;i.nodeType==t.PROCESSING_INSTRUCTION_NODE&&(i=i.nextSibling);var j=c(i);return e[j]=h(i),e}if(b.nodeType==t.ELEMENT_NODE){var e=new Object;e.__cnt=0;for(var k=b.childNodes,l=0;l":">"}function j(a,b){return""}function k(a,b){return-1!==a.indexOf(b,a.length-b.length)}function l(b,c){return!!("property"==a.arrayAccessForm&&k(c.toString(),"_asArray")||0==c.toString().indexOf(a.attributePrefix)||0==c.toString().indexOf("__")||b[c]instanceof Function)}function m(a){var b=0;if(a instanceof Object)for(var c in a)l(a,c)||b++;return b}function n(b){var c=[];if(b instanceof Object)for(var d in b)-1==d.toString().indexOf("__")&&0==d.toString().indexOf(a.attributePrefix)&&c.push(d);return c}function o(b){var c="";return null!=b.__cdata&&(c+=""),null!=b.__text&&(a.escapeMode?c+=e(b.__text):c+=b.__text),c}function p(b){var c="";return b instanceof Object?c+=o(b):null!=b&&(a.escapeMode?c+=e(b):c+=b),c}function q(a,b,c){var d="";if(0==a.length)d+=i(a,b,c,!0);else for(var e=0;e0)for(var c in a)if(!l(a,c)){var d=a[c],e=n(d);if(null==d||void 0==d)b+=i(d,c,e,!0);else if(d instanceof Object)if(d instanceof Array)b+=q(d,c,e);else{var f=m(d);f>0||null!=d.__text||null!=d.__cdata?(b+=i(d,c,e,!1),b+=r(d),b+=j(d,c)):b+=i(d,c,e,!0)}else b+=i(d,c,e,!1),b+=p(d),b+=j(d,c)}return b+=p(a)}var s="1.1.2";a=a||{},b();var t={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,DOCUMENT_NODE:9,PROCESSING_INSTRUCTION_NODE:7};this.parseXmlString=function(a){if(void 0===a)return null;var b;if(window.DOMParser){b=(new window.DOMParser).parseFromString(a,"text/xml")}else 0==a.indexOf("")+2)),b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a);return b},this.asArray=function(a){return a instanceof Array?a:[a]},this.xml2json=function(a){return h(a)},this.xml_str2json=function(a){var b=this.parseXmlString(a);return this.xml2json(b)},this.json2xml_str=function(a){return r(a)},this.json2xml=function(a){var b=this.json2xml_str(a);return this.parseXmlString(b)},this.getVersion=function(){return s}}window.Modernizr=function(a,b,c){function d(a){t.cssText=a}function e(a,b){return d(x.join(a+";")+(b||""))}function f(a,b){return typeof a===b}function g(a,b){return!!~(""+a).indexOf(b)}function h(a,b){for(var d in a){var e=a[d];if(!g(e,"-")&&t[e]!==c)return"pfx"!=b||e}return!1}function i(a,b,d){for(var e in a){var g=b[a[e]];if(g!==c)return!1===d?a[e]:f(g,"function")?g.bind(d||b):g}return!1}function j(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+z.join(d+" ")+d).split(" ");return f(b,"string")||f(b,"undefined")?h(e,b):(e=(a+" "+A.join(d+" ")+d).split(" "),i(e,b,c))}function k(){o.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),j.id=r,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=q.style.overflow,q.style.overflow="hidden",q.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),q.style.overflow=i),!!g},I=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return H("@media "+b+" { #"+r+" { position: absolute; } }",function(b){d="absolute"==(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},J=function(){function a(a,e){e=e||b.createElement(d[a]||"div"),a="on"+a;var g=a in e;return g||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(a,""),g=f(e[a],"function"),f(e[a],"undefined")||(e[a]=c),e.removeAttribute(a))),e=null,g}var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a}(),K={}.hasOwnProperty;m=f(K,"undefined")||f(K.call,"undefined")?function(a,b){return b in a&&f(a.constructor.prototype[b],"undefined")}:function(a,b){return K.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=G.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(G.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(G.call(arguments)))};return d}),C.flexbox=function(){return j("flexWrap")},C.flexboxlegacy=function(){return j("boxDirection")},C.canvas=function(){var a=b.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))},C.canvastext=function(){return!(!o.canvas||!f(b.createElement("canvas").getContext("2d").fillText,"function"))},C.webgl=function(){return!!a.WebGLRenderingContext},C.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:H(["@media (",x.join("touch-enabled),("),r,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=9===a.offsetTop}),c},C.geolocation=function(){return"geolocation"in navigator},C.postmessage=function(){return!!a.postMessage},C.websqldatabase=function(){return!!a.openDatabase},C.indexedDB=function(){return!!j("indexedDB",a)},C.hashchange=function(){return J("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},C.history=function(){return!(!a.history||!history.pushState)},C.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},C.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},C.rgba=function(){return d("background-color:rgba(150,255,150,.5)"),g(t.backgroundColor,"rgba")},C.hsla=function(){return d("background-color:hsla(120,40%,100%,.5)"),g(t.backgroundColor,"rgba")||g(t.backgroundColor,"hsla")},C.multiplebgs=function(){return d("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(t.background)},C.backgroundsize=function(){return j("backgroundSize")},C.borderimage=function(){return j("borderImage")},C.borderradius=function(){return j("borderRadius")},C.boxshadow=function(){return j("boxShadow")},C.textshadow=function(){return""===b.createElement("div").style.textShadow},C.opacity=function(){return e("opacity:.55"),/^0.55$/.test(t.opacity)},C.cssanimations=function(){return j("animationName")},C.csscolumns=function(){return j("columnCount")},C.cssgradients=function(){var a="background-image:";return d((a+"-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));"+a)+x.join("linear-gradient(left top,#9f9, white);"+a)).slice(0,-a.length)),g(t.backgroundImage,"gradient")},C.cssreflections=function(){return j("boxReflect")},C.csstransforms=function(){return!!j("transform")},C.csstransforms3d=function(){var a=!!j("perspective");return a&&"webkitPerspective"in q.style&&H("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=9===b.offsetLeft&&3===b.offsetHeight}),a},C.csstransitions=function(){return j("transition")},C.fontface=function(){var a;return H('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&0===g.indexOf(d.split(" ")[0])}),a},C.generatedcontent=function(){var a;return H(["#",r,"{font:0/0 a}#",r,':after{content:"',v,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},C.video=function(){var a=b.createElement("video"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(a){}return c},C.audio=function(){var a=b.createElement("audio"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(a){}return c},C.localstorage=function(){try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(a){return!1}},C.sessionstorage=function(){try{return sessionStorage.setItem(r,r),sessionStorage.removeItem(r),!0}catch(a){return!1}},C.webworkers=function(){return!!a.Worker},C.applicationcache=function(){return!!a.applicationCache},C.svg=function(){return!!b.createElementNS&&!!b.createElementNS(B.svg,"svg").createSVGRect},C.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==B.svg},C.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(w.call(b.createElementNS(B.svg,"animate")))},C.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(w.call(b.createElementNS(B.svg,"clipPath")))};for(var L in C)m(C,L)&&(l=L.toLowerCase(),o[l]=C[L](),F.push((o[l]?"":"no-")+l));return o.input||k(),o.addTest=function(a,b){if("object"==typeof a)for(var d in a)m(a,d)&&o.addTest(d,a[d]);else{if(a=a.toLowerCase(),o[a]!==c)return o;b="function"==typeof b?b():b,void 0!==p&&p&&(q.className+=" "+(b?"":"no-")+a),o[a]=b}return o},d(""),s=u=null,function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=r.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=q[a[o]];return b||(b={},p++,a[o]=p,q[p]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():n.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),f.canHaveChildren&&!m.test(a)?d.frag.appendChild(f):f}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;g",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return void 0===a.cloneNode||void 0===a.createDocumentFragment||void 0===a.createElement}()}catch(a){j=!0,k=!0}}();var r={elements:l.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==l.shivCSS,supportsUnknownElements:k,shivMethods:!1!==l.shivMethods,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=r,i(b)}(this,b),o._version=n,o._prefixes=x,o._domPrefixes=A,o._cssomPrefixes=z,o.mq=I,o.hasEvent=J,o.testProp=function(a){return h([a])},o.testAllProps=j,o.testStyles=H,o.prefixed=function(a,b,c){return b?j(a,b,c):j(a,"pfx")},q.className=q.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+F.join(" "):""),o}(this,this.document),function(a){var b=document.createElement("input"),c="oninput"in b&&(!("documentMode"in document)||document.documentMode>9),d=function(a){return"INPUT"===a.nodeName&&("text"===a.type||"password"===a.type)},e=null,f=null,g=null,h={get:function(){return g.get.call(this)},set:function(a){f=a,g.set.call(this,a)}},i=function(a){e=a,f=a.value,g=Object.getOwnPropertyDescriptor(a.constructor.prototype,"value"),Object.defineProperty(e,"value",h),e.attachEvent("onpropertychange",k)},j=function(){e&&(delete e.value,e.detachEvent("onpropertychange",k),e=null,f=null,g=null)},k=function(b){if("value"===b.propertyName){var c=b.srcElement.value;c!==f&&(f=c,a(e).trigger("textchange"))}};c?a(document).on("input",function(b){"TEXTAREA"!==b.target.nodeName&&a(b.target).trigger("textchange")}):a(document).on("focusin",function(a){d(a.target)&&(j(),i(a.target))}).on("focusout",function(){j()}).on("selectionchange keyup keydown",function(){e&&e.value!==f&&(f=e.value,a(e).trigger("textchange"))})}(jQuery),function(){function a(a){function b(b,c,d,e,f,g){for(;f>=0&&f0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function b(a){return function(b,c,d){c=u(c,d);for(var e=z(b),f=a>0?0:e-1;f>=0&&f0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(k.call(d,g,h),s.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&f=0&&b<=y};s.each=s.forEach=function(a,b,c){b=t(b,c);var d,e;if(A(a))for(d=0,e=a.length;d=0},s.invoke=function(a,b){var c=k.call(arguments,2),d=s.isFunction(b);return s.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},s.pluck=function(a,b){return s.map(a,s.property(b))},s.where=function(a,b){return s.filter(a,s.matcher(b))},s.findWhere=function(a,b){return s.find(a,s.matcher(b))},s.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=A(a)?a:s.values(a);for(var h=0,i=a.length;hf&&(f=d)}else b=u(b,c),s.each(a,function(a,c,d){((e=b(a,c,d))>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},s.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=A(a)?a:s.values(a);for(var h=0,i=a.length;hd||void 0===c)return 1;if(cb?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(i,k)),f}},s.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=s.now()-g;j=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=s.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},s.wrap=function(a,b){return s.partial(b,a)},s.negate=function(a){return function(){return!a.apply(this,arguments)}},s.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},s.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},s.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),a<=1&&(b=null),c}},s.once=s.partial(s.before,2);var E=!{toString:null}.propertyIsEnumerable("toString"),F=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];s.keys=function(a){if(!s.isObject(a))return[];if(o)return o(a);var b=[];for(var c in a)s.has(a,c)&&b.push(c);return E&&d(a,b),b},s.allKeys=function(a){if(!s.isObject(a))return[];var b=[];for(var c in a)b.push(c);return E&&d(a,b),b},s.values=function(a){for(var b=s.keys(a),c=b.length,d=Array(c),e=0;e":">",'"':""","'":"'","`":"`"},I=s.invert(H),J=function(a){var b=function(b){return a[b]},c="(?:"+s.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};s.escape=J(H),s.unescape=J(I),s.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),s.isFunction(d)?d.call(a):d};var K=0;s.uniqueId=function(a){var b=++K+"";return a?a+b:b},s.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var L=/(.)^/,M={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},N=/\\|'|\r|\n|\u2028|\u2029/g,O=function(a){return"\\"+M[a]};s.template=function(a,b,c){!b&&c&&(b=c),b=s.defaults({},b,s.templateSettings);var d=RegExp([(b.escape||L).source,(b.interpolate||L).source,(b.evaluate||L).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(N,O),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(a){throw a.source=f,a}var h=function(a){return g.call(this,a,s)},i=b.variable||"obj";return h.source="function("+i+"){\n"+f+"}",h},s.chain=function(a){var b=s(a);return b._chain=!0,b};var P=function(a,b){return a._chain?s(b).chain():b};s.mixin=function(a){s.each(s.functions(a),function(b){var c=s[b]=a[b];s.prototype[b]=function(){var a=[this._wrapped];return j.apply(a,arguments),P(this,c.apply(s,a))}})},s.mixin(s),s.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=g[a];s.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments), "shift"!==a&&"splice"!==a||0!==c.length||delete c[0],P(this,c)}}),s.each(["concat","join","slice"],function(a){var b=g[a];s.prototype[a]=function(){return P(this,b.apply(this._wrapped,arguments))}}),s.prototype.value=function(){return this._wrapped},s.prototype.valueOf=s.prototype.toJSON=s.prototype.value,s.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return s})}.call(this),function(){var a,b=this,c=b.Backbone,d=[],e=d.push,f=d.slice,g=d.splice;a="undefined"!=typeof exports?exports:b.Backbone={},a.VERSION="1.0.0";var h=b._;h||"undefined"==typeof require||(h=require("underscore")),a.$=b.jQuery||b.Zepto||b.ender||b.$,a.noConflict=function(){return b.Backbone=c,this},a.emulateHTTP=!1,a.emulateJSON=!1;var i=a.Events={on:function(a,b,c){return k(this,"on",a,[b,c])&&b?(this._events||(this._events={}),(this._events[a]||(this._events[a]=[])).push({callback:b,context:c,ctx:c||this}),this):this},once:function(a,b,c){if(!k(this,"once",a,[b,c])||!b)return this;var d=this,e=h.once(function(){d.off(a,e),b.apply(this,arguments)});return e._callback=b,this.on(a,e,c)},off:function(a,b,c){var d,e,f,g,i,j,l,m;if(!this._events||!k(this,"off",a,[b,c]))return this;if(!a&&!b&&!c)return this._events={},this;for(g=a?[a]:h.keys(this._events),i=0,j=g.length;i").attr(b);this.setElement(c,!1)}}}),a.sync=function(b,c,d){var e=y[b];h.defaults(d||(d={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var f={type:e,dataType:"json"};if(d.url||(f.url=h.result(c,"url")||K()),null!=d.data||!c||"create"!==b&&"update"!==b&&"patch"!==b||(f.contentType="application/json",f.data=JSON.stringify(d.attrs||c.toJSON(d))),d.emulateJSON&&(f.contentType="application/x-www-form-urlencoded",f.data=f.data?{model:f.data}:{}),d.emulateHTTP&&("PUT"===e||"DELETE"===e||"PATCH"===e)){f.type="POST",d.emulateJSON&&(f.data._method=e);var g=d.beforeSend;d.beforeSend=function(a){if(a.setRequestHeader("X-HTTP-Method-Override",e),g)return g.apply(this,arguments)}}"GET"===f.type||d.emulateJSON||(f.processData=!1),"PATCH"!==f.type||!window.ActiveXObject||window.external&&window.external.msActiveXFilteringEnabled||(f.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var i=d.xhr=a.ajax(h.extend(f,d));return c.trigger("request",c,i,d),i};var y={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var z=a.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},A=/\((.*?)\)/g,B=/(\(\?)?:\w+/g,C=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(z.prototype,i,{initialize:function(){},route:function(b,c,d){h.isRegExp(b)||(b=this._routeToRegExp(b)),h.isFunction(c)&&(d=c,c=""),d||(d=this[c]);var e=this;return a.history.route(b,function(f){var g=e._extractParameters(b,f);d&&d.apply(e,g),e.trigger.apply(e,["route:"+c].concat(g)),e.trigger("route",c,g),a.history.trigger("route",e,c,g)}),this},navigate:function(b,c){return a.history.navigate(b,c),this},_bindRoutes:function(){if(this.routes){this.routes=h.result(this,"routes");for(var a,b=h.keys(this.routes);null!=(a=b.pop());)this.route(a,this.routes[a])}},_routeToRegExp:function(a){return a=a.replace(D,"\\$&").replace(A,"(?:$1)?").replace(B,function(a,b){return b?a:"([^/]+)"}).replace(C,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){var c=a.exec(b).slice(1);return h.map(c,function(a){return a?decodeURIComponent(a):null})}});var E=a.History=function(){this.handlers=[],h.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},F=/^[#\/]|\s+$/g,G=/^\/+|\/+$/g,H=/msie [\w.]+/,I=/\/$/;E.started=!1,h.extend(E.prototype,i,{interval:50,getHash:function(a){var b=(a||this).location.href.match(/#(.*)$/);return b?b[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||!this._wantsHashChange||b){a=this.location.pathname;var c=this.root.replace(I,"");a.indexOf(c)||(a=a.substr(c.length))}else a=this.getHash();return a.replace(F,"")},start:function(b){if(E.started)throw new Error("Backbone.history has already been started");E.started=!0,this.options=h.extend({},{root:"/"},this.options,b),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var c=this.getFragment(),d=document.documentMode,e=H.exec(navigator.userAgent.toLowerCase())&&(!d||d<=7);this.root=("/"+this.root+"/").replace(G,"/"),e&&this._wantsHashChange&&(this.iframe=a.$('",{id:a,src:d}),this.$container.append(this.$iframe),this.player=$f(this.$iframe[0]),this.player.addEvent("ready",c(function(a){this.is_ready.resolve(),this.player.addEvent("play",c(function(){this._fire("play")}).bind(this)),this.player.addEvent("pause",c(function(){this._fire("pause")}).bind(this)),this.player.addEvent("finish",c(function(){this._fire("finish")}).bind(this)),this._fire("ready")}).bind(this))},e.fn._isReady=function(){return"resolved"===this.is_ready.state()},e.fn._fire=function(a){if(!1===c.isString(a))throw new Error("An event id is required.");if(!0===c.has(this.event_handlers,a))for(var b=this.event_handlers[a],d=0,e=b.length;d-1&&this.event_handlers[a].splice(d,1)}else!1===c.isUndefined(a)?!0===c.has(this.event_handlers,a)&&(this.event_handlers[a]=[]):this.event_handlers={};return this},e.fn._loadFroogaloopApi=function(){return c.isUndefined(this.froogaloop_api_promise)&&(this.froogaloop_api_promise=b.getScript("/static/core/vendors/froogaloop/froogaloop.js")),this.froogaloop_api_promise},e.fn.create=function(a){if(!0===c.isUndefined(a))throw new Error("A vimeo id is required.");return this.vimeo_id=a,b.when(this._loadFroogaloopApi()).then(c(this._create).bind(this)).fail(function(){console.log("Failed to load Froogaloop API.")}),this.is_ready},e.fn.play=function(){if(!1!==this._isReady())return this.player.api("play"),this},e.fn.pause=function(){if(!1!==this._isReady())return this.player.api("pause"),this},e.fn.destroy=function(){if(!1!==this._isReady()){try{this.$iframe.removeAttr("src"),this.$container.empty()}catch(a){}return this.player=null,this.is_ready=b.Deferred(),null}},e.fn.load=function(a){return this.vimeo_id=a,this.destroy(),this.create(a)},e.fn.loadAndPlay=function(a){this.vimeo_id=a,this.destroy() ;var d=this.create(a);return b.when(d).then(c(this.play).bind(this)),d},e.fn.hasPlayer=function(){return!1===c.isNull(this.player)}}.call(this),function(){var a=this,b=a.jQuery,c=a._,d=NR.resolve("SDM.Core.Components"),e=function(b){a.onYouTubeIframeAPIReady=b},f=null,g=d.YoutubeVideoPlayer=function(a){var c={is_mobile:!1,$container:null,event_handlers:{}};this.config=b.extend(!0,c,a||{}),this._initialize()};g.fn=g.prototype,g.fn._initialize=function(){if(!1===c.isObject(this.config.event_handlers))throw new Error("Event hanlders must be an object.");if(this.youtube_id=null,this.is_ready=b.Deferred(),this.$container=this.config.$container,0==!!this.$container.attr("id"))return console.log("Youtube player container must have an id attribute."),null;this.event_handlers={},c.each(this.config.event_handlers,function(a,b){this._setEventHandler(b,a)},this),this.player=null},g.fn._create=function(){f=a.YT;var d=this.$container.attr("id"),e=d+"-innercontainer",g=b("
",{id:e});this.$container.empty().append(g),this.player=new f.Player(e,{videoId:this.youtube_id,playerVars:{wmode:"opaque",controls:this.config.is_mobile?0:1,rel:0},events:{onReady:c(function(){this.is_ready.resolve(),this._fire("ready")}).bind(this),onStateChange:c(function(a){f.PlayerState.ENDED===a.data?this._fire("finish"):f.PlayerState.PLAYING===a.data?this._fire("play"):f.PlayerState.PAUSED===a.data&&this._fire("pause")}).bind(this)}})},g.fn._isReady=function(){return"resolved"===this.is_ready.state()},g.fn._fire=function(a){if(!1===c.isString(a))throw new Error("An event id is required.");if(!0===c.has(this.event_handlers,a))for(var b=this.event_handlers[a],d=0,e=b.length;d-1&&this.event_handlers[a].splice(d,1)}else!1===c.isUndefined(a)?!0===c.has(this.event_handlers,a)&&(this.event_handlers[a]=[]):this.event_handlers={};return this},g.fn._loadYoutubeIframeApi=function(){if(c.isUndefined(this.youtube_iframe_api_promise)){var d=this;d.youtube_iframe_api_promise=new b.Deferred,b.getScript("https://www.youtube.com/iframe_api"),e(function(){d.youtube_iframe_api_promise.resolve(),a.isYouTubeIframeAPIReady=!0})}return this.youtube_iframe_api_promise},g.fn.create=function(d){if(!0===c.isUndefined(d))throw new Error("A youtube id is required.");return this.youtube_id=d,b.when(a.isYouTubeIframeAPIReady||this._loadYoutubeIframeApi()).then(c(this._create).bind(this)).fail(function(){console.log("Failed to load Youtube API.")}),this.is_ready},g.fn.play=function(){if(!1!==this._isReady())return this.player.playVideo(),this},g.fn.pause=function(){if(!1!==this._isReady())return this.player.pauseVideo(),this},g.fn.destroy=function(){if(!1!==this._isReady())return this.player.stopVideo(),this.$container.empty(),this.player=null,this.is_ready=b.Deferred(),null},g.fn.load=function(a){if(!1!==this._isReady())return this.youtube_id=a,this.player.cueVideoById(this.youtube_id),this.is_ready},g.fn.loadAndPlay=function(a){if(!1!==this._isReady())return this.youtube_id=a,this.player.loadVideoById(this.youtube_id),this.is_ready},g.fn.hasPlayer=function(){return!1===c.isNull(this.player)}}.call(this),function(){var a=this,b=a.jQuery,c=a._,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Components"),f=d.resolve("SDM.Core.Components.VimeoVideoPlayer"),g=d.resolve("SDM.Core.Components.YoutubeVideoPlayer"),h=e.VideoPlayer=function(a){var c={$container:null,event_handlers:{}};this.config=b.extend(!0,c,a||{}),this._initialize()};h.fn=h.prototype,h.type={YOUTUBE:0,VIMEO:1},h.fn._initialize=function(){if(!0===c.isNull(this.config.$container))throw new Error("A container element (jQuery object) must be set at construction.");this.current_type=null,this.apis={}},h.fn.getCurrentApi=function(){return!0===c.isNull(this.current_type)?null:this._getApi(this.current_type)},h.fn._getApi=function(a){if(!1===c.has(this.apis,a))if(h.type.YOUTUBE===a)this.apis[a]=new g(this.config);else{if(h.type.VIMEO!==a)throw new Error("Unknown type.");this.apis[a]=new f(this.config)}return this.apis[a]},h.fn.load=function(a,d,e){if(!0===c.isUndefined(d))throw new Error("A video id is required.");if(!1===c.isUndefined(e)&&!1===c.isFunction(e))throw new Error("Callback must be a function.");var f,g=this._getApi(a);a!==this.current_type&&!1===c.isNull(this.getCurrentApi())&&this.getCurrentApi().destroy(),this.current_type=a,f=!1===g.hasPlayer()?g.create(d):g.load(d),!0===c.isFunction(e)&&b.when(f).then(b.proxy(e,this))},h.fn.loadAndPlay=function(a,b){this.load(a,b,function(){this.play()})},h.fn.play=function(){var a=this.getCurrentApi();if(console.log(a),!0===c.isNull(a))throw new Error("Could not get current player.");return a.play.call(a)},h.fn.pause=function(){var a=this.getCurrentApi();if(!0===c.isNull(a))throw new Error("Could not get current player.");return a.pause.call(a)},h.fn.destroy=function(){var a=this.getCurrentApi();if(!0===c.isNull(a))throw new Error("Could not get current player.");return a.destroy.call(a)}}.call(this),function(){var a=this,b=a.jQuery,c=a._,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Components"),f=d.resolve("SDM.Core.Components.VideoPlayer"),g=d.resolve("SDM.Util"),h=e.VideoPanel=function(a,c){var d="fr"==g.getShortLanguageCode()?"ferme":"Close",e={attributes:{video_player_container:"data-wg-vp-video-player-container",video_player_id:"data-wg-vp-video-player-id",youtube_id:"data-wg-vp-youtube-id",vimeo_id:"data-wg-vp-vimeo-id"},classes:{panel_has_open_modal:"wg-vp-panel-has-open-modal",pc_video_container_class:"",mobile_video_container_class:""},selectors:{container:"[data-widget-video-panel]",button_play:"[data-wg-vp-play]",button_stop:"[data-wg-vp-stop]",is_panel_mobile:"[data-wg-vp-mobile]"},templates:{modal_pc:'
id="<%= video_player_id %>">
',modal_mobile:'
id="<%= video_player_id %>">
',close_button:''}};this.config=b.extend(!0,e,{},c||{}),this._setInstanceVars(a),this._initialize()};h.prototype._setInstanceVars=function(a){this.$container=a.$container,this.$closeButtonContainer=a.$closeButtonContainer,this.$modalContainer=!c.isUndefined(a.$modalContainer)&&a.$modalContainer.length?a.$modalContainer:a.$container,this._subscribers={},this._is_mobile=this.$container.length&&this.$container.is(this.config.selectors.is_panel_mobile),this._is_modal_open=!1},h.prototype._initialize=function(){if(!this.$container.is(this.config.selectors.container))return console.log("A carousel video panel container has to have attribute "+this.config.selectors.container+"."),void console.log(this.$container[0]);this.video_player_id=this.$container.attr(this.config.attributes.video_player_id);var a=this.$container.attr(this.config.attributes.youtube_id),d=this.$container.attr(this.config.attributes.vimeo_id);if(c.isUndefined(this.video_player_id))return console.log("A carousel video panel container must have a "+this.config.attributes.video_player_id+" attribute."),void console.log(this.$container[0]);if(c.isUndefined(a)&&c.isUndefined(d))return console.log("A carousel video panel container must have either "+this.config.attributes.youtube_id+" attribute or "+this.config.attributes.vimeo_id+" attribute."),void console.log(this.$container[0]);try{this.mobile_modal_template=c.template(this.config.templates.modal_mobile)}catch(a){return void console.log("Invalid mobile modal template.")}try{this.pc_modal_template=c.template(this.config.templates.modal_pc)}catch(a){return void console.log("Invalid pc modal template.")}if(!(this.$closeButtonContainer&&this.$closeButtonContainer.length>0))return void console.log("No close button container found.");var e=c.template(this.config.templates.close_button)();this.$closeButtonContainer.append(e),!0===this.$container.is("["+this.config.attributes.youtube_id+"]")?(this.video_type=f.type.YOUTUBE,this.video_id=a):!0===this.$container.is("["+this.config.attributes.vimeo_id+"]")&&(this.video_type=f.type.VIMEO,this.video_id=d);var g=this._is_mobile?this.mobile_modal_template:this.pc_modal_template;this.$modal=b(g({video_player_container_attr:this.config.attributes.video_player_container,video_player_id:this.video_player_id}));var h=this.$modal.find("["+this.config.attributes.video_player_container+"]");this.$modalContainer.append(this.$modal),this.videoPlayer=new f({$container:h,is_mobile:this._is_mobile,event_handlers:{pause:c(this._onVideoPause).bind(this),finish:c(this._onVideoFinish).bind(this)}}),this.bindClickPlayButtonEvent()},h.prototype._fire=function(a){if(!0===c.has(this._subscribers,a)){var b=Array.prototype.slice.call(arguments,1);c.each(this._subscribers[a],c(function(a){a.apply(this,b)}).bind(this))}},h.prototype._hide=function(){this._is_modal_open=!1,this.$container.removeClass(this.config.classes.panel_has_open_modal),this.videoPlayer.destroy(),this._fire("modal.close")},h.prototype._show=function(){this._is_modal_open=!0,this._fire("modal.open"),this.$container.addClass(this.config.classes.panel_has_open_modal),this.bindClickStopButtonEvent(),SDM.Util.isWindowWide()?this.videoPlayer.loadAndPlay(this.video_type,this.video_id):this.videoPlayer.load(this.video_type,this.video_id)},h.prototype.isModalOpen=function(){return this._is_modal_open},h.prototype.bindClickPlayButtonEvent=function(){this.$container.off("click",this.config.selectors.button_play).on("click",this.config.selectors.button_play,c(function(a){a.preventDefault(),this._show()}).bind(this))},h.prototype.bindClickStopButtonEvent=function(){this.$closeButtonContainer.off("click",this.config.selectors.button_stop).on("click",this.config.selectors.button_stop,c(function(a){a.preventDefault(),this._hide()}).bind(this))},h.prototype._onVideoPause=function(){!0===this._is_mobile&&this.video_type===f.type.VIMEO&&this._hide()},h.prototype._onVideoFinish=function(){this._hide()},h.prototype.on=function(a,b){return!1===c.has(this._subscribers,a)&&(this._subscribers[a]=[]),this._subscribers[a].push(b),this},h.prototype.off=function(a,b){if(!0===c.has(this._subscribers,a)){var d=c.indexOf(this._subscribers[a],b);d>-1&&this._subscribers[a].splice(d,1)}return this},h.prototype.closeModal=function(){!1!==this.isModalOpen()&&this._hide()},h.prototype.getId=function(){return this.video_player_id}}.call(this),function(){var a=this,b=a.jQuery,c=a._,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Components"),f=d.resolve("SDM.Core.Components.VideoPlayer"),g=e.VideoPanelDeeplink=function(a,c){var d={attributes:{video_player_container:"data-wg-vp-video-player-container",video_player_id:"data-wg-vp-video-player-id",youtube_id:"data-wg-vp-youtube-id",vimeo_id:"data-wg-vp-vimeo-id"},classes:{panel_has_open_modal:"wg-vp-panel-has-open-modal",pc_video_container_class:"",mobile_video_container_class:""},selectors:{container:"[data-widget-video-panel]",button_play:"[data-wg-vp-play]",button_stop:"[data-wg-vp-stop]",is_panel_mobile:"[data-wg-vp-mobile]"},templates:{modal_pc:'
id="<%= video_player_id %>">
',modal_mobile:'
id="<%= video_player_id %>">
',close_button:''}};this.config=b.extend(!0,d,{},c||{}),this._setInstanceVars(a),this._initialize()};g.prototype._setInstanceVars=function(a){this.$container=a.$container,this.$closeButtonContainer=a.$closeButtonContainer,this.$modalContainer=!c.isUndefined(a.$modalContainer)&&a.$modalContainer.length?a.$modalContainer:a.$container,this._subscribers={},this._is_modal_open=!1,this._hide=function(a){var d=this;if(this._is_modal_open=!1,b(".wg-gt__tile-video-modal-popup").removeClass(this.config.classes.panel_has_open_modal),this.videoPlayer.destroy(),this._fire("modal.close"),b(".wg-gt__tile-video-modal-container").velocity({top:"100%"},300),setTimeout(c.bind(function(){b(document.body).css("position","relative"),b(document.body).css("top",""),b(document.body).css("width",""),window.scrollTo(0,d.modalScrollY)},this),0),setTimeout(c.bind(function(){b(".widget-video-panel-modal").remove()},this),300),history.pushState&&!a){var e=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:e},"",e)}}},g.prototype._initialize=function(){if(this.video_player_id=this.$container.ID,"youtube"===this.$container.VideoType&&(this.video_id=this.$container.URL,this.video_type=f.type.YOUTUBE),"vimeo"===this.$container.VideoType&&(this.video_id=this.$container.URL,this.video_type=f.type.VIMEO),c.isUndefined(this.video_player_id))return console.log("A carousel video panel container must have a "+this.config.attributes.video_player_id+" attribute."),void console.log(this.$container[0]);try{this.mobile_modal_template=c.template(this.config.templates.modal_mobile)}catch(a){return void console.log("Invalid mobile modal template.")}try{this.pc_modal_template=c.template(this.config.templates.modal_pc)}catch(a){return void console.log("Invalid pc modal template.")}if(!(this.$closeButtonContainer&&this.$closeButtonContainer.length>0))return void console.log("No close button container found.");var a=c.template(this.config.templates.close_button)();this.$closeButtonContainer.append(a);var d=this._is_mobile?this.mobile_modal_template:this.pc_modal_template;this.$modal=b(d({video_player_container_attr:this.config.attributes.video_player_container,video_player_id:this.video_player_id}));var e=this.$modal.find("["+this.config.attributes.video_player_container+"]");this.$modalContainer.append(this.$modal),this.videoPlayer=new f({$container:e,is_mobile:this._is_mobile,event_handlers:{pause:c(this._onVideoPause).bind(this),finish:c(this._onVideoFinish).bind(this)}}),this._show()},g.prototype._fire=function(a){if(!0===c.has(this._subscribers,a)){var b=Array.prototype.slice.call(arguments,1);c.each(this._subscribers[a],c(function(a){a.apply(this,b)}).bind(this))}},g.prototype._show=function(){this._is_modal_open=!0,this._fire("modal.open"),this.modalScrollY=window.scrollY,b(".wg-gt__tile-video-modal-popup").addClass(this.config.classes.panel_has_open_modal),this.bindClickStopButtonEvent(),SDM.Util.isWindowWide()?this.videoPlayer.loadAndPlay(this.video_type,this.video_id):this.videoPlayer.load(this.video_type,this.video_id)},g.prototype.isModalOpen=function(){return this._is_modal_open},g.prototype.bindClickPlayButtonEvent=function(){this.$container.off("click",this.config.selectors.button_play).on("click",this.config.selectors.button_play,c(function(a){a.preventDefault(),this._show()}).bind(this))},g.prototype.bindClickStopButtonEvent=function(){this.$closeButtonContainer.off("click",this.config.selectors.button_stop).on("click",this.config.selectors.button_stop,c(function(a){a.preventDefault()}).bind(this))},g.prototype._onVideoPause=function(){!0===this._is_mobile&&this.video_type===f.type.VIMEO&&this._hide(!1)},g.prototype._onVideoFinish=function(){this._hide(!1)},g.prototype.on=function(a,b){return!1===c.has(this._subscribers,a)&&(this._subscribers[a]=[]),this._subscribers[a].push(b),this},g.prototype.off=function(a,b){if(!0===c.has(this._subscribers,a)){var d=c.indexOf(this._subscribers[a],b);d>-1&&this._subscribers[a].splice(d,1)}return this},g.prototype.closeModal=function(){!1!==this.isModalOpen()&&this._hide(!1)},g.prototype.getId=function(){return this.video_player_id}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=a.CarouselView,f=a.CarouselModel,g=a.CarouselViewAnimations,h=d.resolve("SDM.Core.Components"),i=h.SliderCarouselController=function(a,b){var d={toggle_at_once:null,circulate:!1,swipe:{min_move_x:5}};this.config=c.extend(!0,d,{},b||{}),this._setInstanceVars(a)};i.prototype._setInstanceVars=function(a){this.view=new e({$container:a.$container}),this.model=new f({number_of_panels:this.view.getPanelSize()}),this.no_duration_animation=g.slide(0),this.callbacks={}},i.prototype._fire=function(a,c){c=b(c).isArray()?c:[],this.callbacks[a]&&b(this.callbacks[a]).each(function(a){a.apply({},c)})},i.prototype.off=function(a){this.callbacks[a]&&(this.callbacks[a]=[])},i.prototype.on=function(a,b){this.callbacks[a]&&this.callbacks[a].push(b)},i.prototype.bindModelEvents=function(){this.model.on("changeIndex",b(function(){this.updateToggleButtonVisibility(),this.updatePaginationButtonActiveClass(),this.animateCarousel()}).bind(this))},i.prototype.bindViewEvents=function(){this.view.off("clickNextButton"),this.view.on("clickNextButton",b(function(){this.goToNext()}).bind(this)),this.view.off("clickPreviousButton"),this.view.on("clickPreviousButton",b(function(){this.goToPrevious()}).bind(this)),this.view.off("clickPaginationButton"),this.view.on("clickPaginationButton",b(function(a){this.model.setIndex(a.index)}).bind(this)),this.view.off("resize"),this.view.on("resize",b(function(){var a=this.view.$container.find(this.view.selectors.panel).eq(this.getCurrentIndex());0!==a.length&&(c(this.view.selectors.panel_container,this.view.$container)[0].style.left="-"+a.position().left+"px")}).bind(this)),this.view.off("swipePanelContainer"),this.view.on("swipePanelContainer",b(function(a,b,c){this.config.swipe.min_move_x<=b?(this.goToNext(),a.preventDefault()):b<=-this.config.swipe.min_move_x&&(this.goToPrevious(),a.preventDefault())}).bind(this))},i.prototype.goToNext=function(){null!==this.model.getIndexOfNextBreakPoint(this.config.circulate)&&(this.config.toggle_at_once?this.model.setIndex(this.model.getAdvancedIndex(this.config.toggle_at_once,!1)):this.model.setIndex(this.model.getIndexOfNextBreakPoint(this.config.circulate)))},i.prototype.goToPrevious=function(){null!==this.model.getIndexOfPreviousBreakPoint(this.config.circulate)&&(this.config.toggle_at_once?this.model.setIndex(this.model.getEarlierIndex(this.config.toggle_at_once,!1)):this.model.setIndex(this.model.getIndexOfPreviousBreakPoint(this.config.circulate)))},i.prototype.updateToggleButtonVisibility=function(){null!==this.model.getIndexOfNextBreakPoint(this.config.circulate)?this.view.showNextButton():this.view.hideNextButton(),null!==this.model.getIndexOfPreviousBreakPoint(this.config.circulate)?this.view.showPreviousButton():this.view.hidePreviousButton()},i.prototype.getCurrentIndex=function(){return this.model.getCurrentIndex()},i.prototype.updatePaginationButtonActiveClass=function(){this.view.activatePaginationButton(this.model.getCurrentIndex())},i.prototype.updatePaginationButtonVisibility=function(){this.view.showAndHidePaginationButtonByFilterCallback(b(function(a){return this.model.size()>this.model.number_of_visible&&this.model.isBreakPointIndex(a)}).bind(this))},i.prototype.animateCarousel=function(){this.view.animate(this.model.getCurrentIndex())},i.prototype.setModelIndexSilently=function(a){var b=this.view.getAnimation();this.view.setAnimation(this.no_duration_animation),this.model.setIndex(a),this.model.isValidIndex(a)&&this.view.animate(a),this.view.setAnimation(b)},i.prototype.setToggleAtOnce=function(a){this.config.toggle_at_once=a},i.prototype.setPanelWidth=function(a){this.view.setPanelWidth(a)},i.prototype.removePanelWidth=function(){this.view.removePanelWidth()},i.prototype.setNumberOfVisible=function(a){this.model.setNumberOfVisible(a)},i.prototype.getCarouselWidth=function(){return this.view.getCarouselWidth()},i.prototype.setAnimation=function(a){this.view.setAnimation(a)},i.prototype.renderPanels=function(a){this.view.renderPanels(a)},i.prototype.renderPaginationButtons=function(a){this.view.renderPaginationButtons(a)},i.prototype.setNumberOfPanels=function(a){this.model.setNumberOfPanels(a)},i.prototype.hideMainContainer=function(){this.view.hidePanelContainer(),this.view.makePaginationButtonContainerInvisible(),this.view.hideNextButton(),this.view.hidePreviousButton()},i.prototype.showMainContainer=function(){this.view.showPanelContainer(),this.view.makePaginationButtonContainerVisible()}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Components"),f="slider-carousel",g=a.CarouselViewAnimations,h=e.SliderCarouselController,i=e.VideoPanel,j=null;j=e.SliderCarousel=function(a,b){var d={selectors:{carousel_container:"[data-wg-scrs-carousel-container]",video_panel:"[data-widget-video-panel]",video_container:"[data-wg-scrs-video-container]",close_button_container:"[data-wg-scrs-video-close-button-container]",text_overflow:"[data-ml-text-overflow]"},attributes:{pc_visible:"wg-scrs-number-visible-pc",tablet_visible:"wg-scrs-number-visible-tablet",mob_visible:"wg-scrs-number-visible-mob",pc_toggle_at_once:"wg-scrs-toggle-at-once-pc",tablet_toggle_at_once:"wg-scrs-toggle-at-once-tablet",mob_toggle_at_once:"wg-scrs-toggle-at-once-mob",circulate:"wg-scrs-circulate"},setting:{pc:{animation_duration:500,number_of_visible:3,toggle_at_once:!1},tablet:{animation_duration:500,number_of_visible:2,toggle_at_once:!1},mob:{animation_duration:500,number_of_visible:1,toggle_at_once:!1}}};this.config=c.extend(!0,d,b||{}),this._setInstanceVars(a),this._initialize(),this._initializeDesktopVideoPanels()},j.prototype._setInstanceVars=function(a){this.$container=a.find(this.config.selectors.carousel_container),this.videoPanels={},this.$module=a,this.controller=new h({$container:this.$container},{circulate:a.data(this.config.attributes.circulate)}),this.pc_animation=g.slide(this.config.setting.pc.animation_duration),this.tablet_animation=g.slide(this.config.setting.tablet.animation_duration),this.mob_animation=g.slide(this.config.setting.mob.animation_duration),this.config.setting.pc.number_of_visible=parseInt(a.data(this.config.attributes.pc_visible),10)||this.config.setting.pc.number_of_visible,this.config.setting.tablet.number_of_visible=parseInt(a.data(this.config.attributes.tablet_visible),10)||this.config.setting.tablet.number_of_visible,this.config.setting.mob.number_of_visible=parseFloat(a.data(this.config.attributes.mob_visible),10)||this.config.setting.mob.number_of_visible,this.config.setting.pc.toggle_at_once=parseInt(a.data(this.config.attributes.pc_toggle_at_once),10)||this.config.setting.pc.toggle_at_once,this.config.setting.tablet.toggle_at_once=parseInt(a.data(this.config.attributes.tablet_toggle_at_once),10)||this.config.setting.tablet.toggle_at_once,this.config.setting.mob.toggle_at_once=parseInt(a.data(this.config.attributes.mob_toggle_at_once),10)||this.config.setting.mob.toggle_at_once},j.prototype._initialize=function(){this.controller.bindViewEvents(),this.controller.bindModelEvents(),this._updateMode(),this._bindResizeEvents()},j.prototype._initializeDesktopVideoPanels=function(){var a=this.$module.find(this.config.selectors.video_panel);b.each(a,b(function(a){var d=c(a),e=new i({$modalContainer:d.find(this.config.selectors.video_container),$container:d,$closeButtonContainer:d.find(this.config.selectors.close_button_container)});e.on("modal.open",b(function(){this._closeAllVideosBut(e.getId())}).bind(this)),this.videoPanels[e.getId()]=e}).bind(this)),this.controller.model.on("changeIndex",b(function(){b.each(this.videoPanels,function(a){a.closeModal()})}).bind(this))},j.prototype._updateTextOverflows=function(){this.$container.find(this.config.selectors.text_overflow).mlTextOverflow()},j.prototype._updateMode=function(){SDM.Util.isWindowNarrow()?this._switchModeToMobile():SDM.Util.isWindowWide()?this._switchModeToTablet():this._switchModeToPC()},j.prototype._closeAllVideosBut=function(a){b.each(this.videoPanels,function(b,c){c!==a&&b.closeModal()})},j.prototype._switchModeToPC=function(){this.controller.setNumberOfVisible(this.config.setting.pc.number_of_visible),this.controller.setAnimation(this.pc_animation),this.controller.setModelIndexSilently(0),this._removeMobPanelWidth(),this.controller.updateToggleButtonVisibility(),this.controller.updatePaginationButtonVisibility(),this.controller.updatePaginationButtonActiveClass(),this.controller.setToggleAtOnce(this.config.setting.pc.toggle_at_once),setTimeout(b.bind(this._updateTextOverflows,this),0)},j.prototype._switchModeToTablet=function(){this.controller.setNumberOfVisible(this.config.setting.tablet.number_of_visible),this.controller.setAnimation(this.tablet_animation),this.controller.setModelIndexSilently(0),this._removeMobPanelWidth(),this.controller.updateToggleButtonVisibility(),this.controller.updatePaginationButtonVisibility(),this.controller.updatePaginationButtonActiveClass(),this.controller.setToggleAtOnce(this.config.setting.tablet.toggle_at_once),setTimeout(b.bind(this._updateTextOverflows,this),0)},j.prototype._switchModeToMobile=function(){this.controller.setNumberOfVisible(this.config.setting.mob.number_of_visible),this.controller.setAnimation(this.mob_animation),this.controller.setModelIndexSilently(0),this._setMobPanelWidth(),this.controller.updateToggleButtonVisibility(),this.controller.updatePaginationButtonVisibility(),this.controller.updatePaginationButtonActiveClass(),this.controller.setToggleAtOnce(this.config.setting.mob.toggle_at_once),setTimeout(b.bind(this._updateTextOverflows,this),0)},j.prototype._setMobPanelWidth=function(){var a=this.$container.width(),b=Math.floor(a/this.config.setting.mob.number_of_visible);b<=0||this.controller.setPanelWidth(b)},j.prototype._removeMobPanelWidth=function(){this.controller.removePanelWidth()},j.prototype._bindResizeEvents=function(){c(window).on("becometoextrawide."+f,b(function(){this._switchModeToPC()}).bind(this)),c(window).on("becometowide."+f,b(function(){this._switchModeToTablet()}).bind(this)),c(window).on("becometonarrow."+f,b(function(){this._switchModeToMobile()}).bind(this)),c(window).on("resizewhennarrow."+f,b(function(){this._setMobPanelWidth(),this.controller.setModelIndexSilently(this.controller.getCurrentIndex())}).bind(this))},j.prototype.renderPanels=function(a){this.controller.renderPanels(a)},j.prototype.renderPaginationButtons=function(a){this.controller.renderPaginationButtons(a)},j.prototype.setNumberOfPanels=function(a){this.controller.setNumberOfPanels(a),this._updateMode()},j.prototype.hideMainContainer=function(){this.controller.hideMainContainer()},j.prototype.showMainContainer=function(){this.controller.showMainContainer()},j.prototype.updateMode=function(){this._updateMode()}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=a.CarouselView,f=a.CarouselModel,g=a.CarouselViewAnimations,h=d.resolve("SDM.Core.Components"),i=d.resolve("SDM.Core.Components.SliderCarousel"),j=d.resolve("SDM.Core.Components.VideoPanel"),k=null;k=h.HeroCarousel=function(a,b){var d={number_of_visible:1,rotate_duration:6e3,animation_duration:1e3,selectors:{pc_carousel:"[data-wg-hcrs-pc-carousel]",mobile_carousel:"[data-wg-hcrs-mobile-carousel]",panel:"[data-wg-crs-panel]",video_panel:"[data-widget-video-panel]",video_container:"[data-wg-hcp-video-container]",close_button_container:"[data-wg-hcp-video-close-button-container]"},data:{seenSlides:[]}};this.config=c.extend(!0,d,b||{}),this.videoPanels=[],this._setInstanceVars(a),this._initialize(),this._initializeDesktopVideoPanels()},k.prototype._setInstanceVars=function(a){this.view=new e({$container:a.find(this.config.selectors.pc_carousel)}),this.model=new f({number_of_panels:this.view.getPanelSize()}),this.mobile_carousel=new i(a.find(this.config.selectors.mobile_carousel)),this.autoRotationIntervalId=null,c(window).on("becometonarrow.sdm-hero-carousel",b(function(){this._switchModeToMobile()}).bind(this))},k.prototype._initialize=function(){if(this.view.setAnimation(g.fade(this.config.animation_duration)),this.view.makeContainerVisible(),this.model.setNumberOfVisible(this.config.number_of_visible),this._bindViewEvents(),this._bindModelEvents(),this._animateCarousel(),this._updateToggleButtonVisibility(),this._updatePaginationButtonActiveClass(),this._startAutoRotation(),window.location.href.includes("home")){for(var a=this.view.$container.find(this.config.selectors.panel),b=a.length,c=this;b--;)a[b].addEventListener("click",function(){var a=this.getAttribute("data-index");c._slideClick(a)}),a[b].addEventListener("auxclick",function(){var a=this.getAttribute("data-index");c._slideClick(a)});null===sessionStorage.getItem("seenAllSlides")?this._isElementInView(a[0])&&(dataLayer.push({event:"slide_impression","slide.position":0,"slide.image_url":document.body.querySelector('.wg-hcp-panel[data-index="0"] .wg-hcp-lnk-image').src}),sessionStorage.setItem("seenAllSlides",[0]),this.config.seenSlides=sessionStorage.getItem("seenAllSlides")):this.config.seenSlides=sessionStorage.getItem("seenAllSlides")}},k.prototype._initializeDesktopVideoPanels=function(){var a=this.view.$container.find(this.config.selectors.video_panel);b.each(a,function(a){var d=c(a),e=new j({$modalContainer:d.find(this.config.selectors.video_container),$container:d,$closeButtonContainer:this.view.$container.find(this.config.selectors.close_button_container)});e.on("modal.open",b(function(){this._stopAutoRotation()}).bind(this)),this.videoPanels.push(e)},this)},k.prototype._switchModeToMobile=function(){b.each(this.videoPanels,function(a){a.closeModal()},this)},k.prototype._updateToggleButtonVisibility=function(){this.view.showNextButton(),this.view.showPreviousButton()},k.prototype._updatePaginationButtonActiveClass=function(){this.view.activatePaginationButton(this.model.getCurrentIndex())},k.prototype._slideClick=function(a){window.location.href.includes("home")&&dataLayer.push({event:"slide_click","slide.position":a,"slide.image_url":document.body.querySelector('.wg-hcp-panel[data-index="'+a+'"] .wg-hcp-lnk-image').src})},k.prototype._isElementInView=function(a){var b=a.getBoundingClientRect(),c=b.top,d=b.top+b.height;return c>=0&&d<=Math.min(document.documentElement.clientHeight,window.innerHeight||0)},k.prototype._sendSlideToAnalytics=function(){if(window.location.href.includes("home")){var a=this.view.$container.find(this.config.selectors.panel);this._isElementInView(a[this.model.getCurrentIndex()])&&this.config.data.seenSlides.lengthb?d+this.paddingRate*d*2:b,g=e>c?e+this.paddingRate*e*2:c;this.$largeFrame.width(f),this.$largeFrame.height(g),this.offsetX=a.left,this.offsetY=a.top,this.scaleX=(f-b)/b,this.scaleY=(g-c)/c},b.prototype._fadeOutNormalImage=function(){this.$normalFrame.stop(!0,!0).animate({opacity:0},this.zoomOutSpeed)},b.prototype._fadeInNormalImage=function(){this.$normalFrame.stop(!0,!0).animate({opacity:1},this.zoomOutSpeed)},b.prototype._fadeInLargeImage=function(){this.$largeFrame.stop(!0,!0).animate({opacity:1},this.zoomOutSpeed)},c.prototype.load=function(){this._$image.attr("src",this._source+"?"+(new Date).getTime()),this._onStartLoadingEventHandler(this._$image)},c.prototype.setOnStartLoadingEventHandler=function(a){this._onStartLoadingEventHandler=a},c.prototype.setOnFinishLoadingEventHandler=function(a){this._$image.off("load."+j),this._$image.on("load."+j,a)},c.prototype.isLoaded=function(){return this._isLoaded},c.prototype.getWidth=function(){return this._$image.width()},c.prototype.getHeight=function(){return this._$image.height()}}.call(this),function(){var a=this,b=this._,c=a.jQuery,d=a.NR,e=d.resolve("SDM.Core.Components.EventHub");e.EVENTS={TAB_SWITCHED:"TAB_SWITCHED",HEADER_TOOL_CLICKED:"HEADER_TOOL_CLICKED",CLOSE_MOBILE_SBU:"CLOSE_MOBILE_SBU",CLOSE_MOBILE_CAMPAIGN_NAV:"CLOSE_MOBILE_CAMPAIGN_NAV",OPEN_MOBILE_CAMPAIGN_NAV:"OPEN_MOBILE_CAMPAIGN_NAV",USER_INFO_UPDATED:"USER_INFO_UPDATED",ADD_MANAGED_POPUP:"ADD_MANAGED_POPUP",CANCEL_ALL_MANAGED_POPUPS:"CANCEL_ALL_MANAGED_POPUPS",COUPON_LOADED:"COUPON_LOADED",BROOKLYN_OFFERS_ERROR:"BROOKLYN_OFFERS_ERROR",MOBILE_NAV_TOGGLE_CLICK:"MOBILE_NAV_TOGGLE_CLICK",MOBILE_NAV_CLOSE_BUSINESS_UNIT:"MOBILE_NAV_CLOSE_BUSINESS_UNIT",MOBILE_NAV_CLOSE_SUB_BUSINESS_UNIT:"MOBILE_NAV_CLOSE_SUB_BUSINESS_UNIT"},e.ArgumentChekers={TAB_SWITCHED:function(a){return 1===a.length&&"string"==typeof a[0].tabId&&a[0].$button instanceof c&&a[0].$content instanceof c},HEADER_TOOL_CLICKED:function(a){return 2===a.length&&"string"==typeof a[0]&&a[1]instanceof c},CLOSE_MOBILE_SBU:function(a){return 0===a.length},CLOSE_MOBILE_CAMPAIGN_NAV:function(a){return 0===a.length},OPEN_MOBILE_CAMPAIGN_NAV:function(a){return 0===a.length},USER_INFO_UPDATED:function(a){return 0===a.length},ADD_MANAGED_POPUP:function(a){return b.isFunction(a[0].openPopUp)},COUPON_LOADED:function(a){return 0===a.length},BROOKLYN_OFFERS_ERROR:function(a){return 1===a.length&&b.isString(a[0])}}}.call(this),function(){var a=this,b=a._,c=a.Backbone,d=a.NR,e=d.resolve("SDM.Core.Components.EventHub"),f=b.extend({},c.Events);e.subscribe=function(a,b,c){e.EVENTS[a]&&f.on(a,b,c)},e.unsubscribe=function(a,b,c){f.off(a,b,c)},e.fire=function(a){var b,c=e.ArgumentChekers[a];if(e.EVENTS[a]){if(b=Array.prototype.slice.call(arguments,1),c&&!c(b))throw new TypeError("The arguments for "+a+" event are incorrect.");b.unshift(a),f.trigger.apply(f,b)}}}.call(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Mixins"),d=a.jQuery,e=b.resolve("SDM.Util");c.Geolocation={data:function(){return{isGeolocationLoading:!1,geolocationCoordinate:{lat:null,lng:null},postalCode:null,provinceCode:null}},methods:{requestCurrentGeolocationPosition:function(b){if(!navigator.geolocation)return void console.log("Geolocation not supported.");this.isGeolocationLoading=!0,navigator.geolocation.getCurrentPosition(function(c){var f={lat:c.coords.latitude,lng:c.coords.longitude};this.geolocationCoordinate=f,"function"==typeof b&&b(),d.when(e.loadGoogleMapsApi()).then(function(){this.geocoder=new a.google.maps.Geocoder,this.geocoder.geocode({location:f},function(b,c){if(c===a.google.maps.GeocoderStatus.OK&&b&&b.length>0)for(var d=b[0],e=d.address_components,f=0;fthis.maxWidthMobile&&this.screenWidth<=this.maxWidthMobileLarge},isTablet:function(){return this.screenWidth>this.maxWidthMobileLarge&&this.screenWidth<=this.maxWidthTablet},isDesktop:function(){return this.screenWidth>this.maxWidthTablet&&this.screenWidth<=this.maxWidthDesktop},isDesktopLarge:function(){return this.screenWidth>this.maxWidthDesktop}},data:function(){return{screenWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),maxWidthMobile:480,maxWidthMobileLarge:640,maxWidthTablet:768,maxWidthDesktop:960}},methods:{onResponsiveResize:function(){this.screenWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0)}},mounted:function(){window.addEventListener("resize",c.debounce(this.onResponsiveResize,100))}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Stores").Donation={actions:{setActivePanel:function(a,b){a.commit("setActivePanel",b)},setMoneyAmount:function(a,b){a.commit("setMoneyAmount",b)},setPcOptimumAmount:function(a,b){a.commit("setPcOptimumAmount",b)},setAddress:function(a,b){a.commit("setAddress",b)}},mutations:{setActivePanel:function(a,b){a.activePanel=b},setMoneyAmount:function(a,b){a.moneyAmount=b},setPcOptimumAmount:function(a,b){a.pcOptimumAmount=b},setAddress:function(a,b){a.address=b}},namespaced:!0,state:function(){return{activePanel:"",moneyAmount:"",panels:{introduction:"introduction",points:"points",money:"money",pcoptimum:"pcoptimum",confirmation:"confirmation",payer:"payer",completion:"completion"},pcOptimumAmount:"",address:{firstName:"",lastName:"",email:"",address1:"",address2:"",city:"",province:"",postalCode:""}}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Stores"),d=b.resolve("SDM.Util");c.StoreSelector={actions:{setCurrentPaginationNumber:function(a,b){a.commit("setCurrentPaginationNumber",b)},setInventories:function(a,b){a.commit("setInventories",b)},setIsStoreSelectorLoading:function(a,b){a.commit("setIsStoreSelectorLoading",b)},setPopUp:function(a,b){a.commit("setPopUp",b)},setPostalCode:function(a,b){a.commit("setPostalCode",b)},setProductImageUrl:function(a,b){a.commit("setProductImageUrl",b)},setProductHeading:function(a,b){a.commit("setProductHeading",b)},setProductSubheading:function(a,b){a.commit("setProductSubheading",b)},setProductUpc:function(a,b){a.commit("setProductUpc",b)},setSelectedStore:function(a,b){a.commit("setSelectedStore",b)},showPopUp:function(a){a.state.popUp&&a.state.popUp.showPopUp()},setStores:function(a,b){a.commit("setStores",b)}},getters:{selectedProduct:function(a){return""===a.productImageUrl&&""===a.productHeading&&""===a.productSubheading&&""===a.productUpc?null:{imageUrl:a.productImageUrl,heading:a.productHeading,subheading:a.productSubheading,upc:a.productUpc}}},mutations:{setInventories:function(a,b){a.inventories=d.mergeObjects(a.inventories,b)},setCurrentPaginationNumber:function(a,b){a.currentPaginationNumber=b},setIsStoreSelectorLoading:function(a,b){a.isStoreSelectorLoading=b},setPopUp:function(a,b){a.popUp=b},setPostalCode:function(a,b){a.postalCode=b},setProductImageUrl:function(a,b){a.productImageUrl=b},setProductHeading:function(a,b){a.productHeading=b},setProductSubheading:function(a,b){a.productSubheading=b},setProductUpc:function(a,b){a.productUpc=b},setSelectedStore:function(a,b){a.selectedStore=b},setStores:function(a,b){a.stores=b}},namespaced:!0,state:function(){return{currentPaginationNumber:1,inventories:{},isStoreSelectorLoading:!1,popUp:null,postalCode:"",productImageUrl:"",productHeading:"",productSubheading:"",productUpc:"",selectedStore:null,stores:[]}}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Stores").ProvinceSelector={actions:{setUserProvinceId:function(a,b){a.commit("setUserProvinceId",b)}},getters:{},mutations:{setUserProvinceId:function(a,b){a.userProvinceId=b}},namespaced:!0,state:function(){return{userProvinceId:""}}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Stores").FindInStore={actions:{setActiveProductListingIndex:function(a,b){a.commit("setActiveProductListingIndex",b)},setListingQuery:function(a,b){a.commit("setListingQuery",b)},setSearchQuery:function(a,b){a.commit("setSearchQuery",b)}},mutations:{setActiveProductListingIndex:function(a,b){a.activeProductListingIndex=b},setListingQuery:function(a,b){a.listingQuery=b},setSearchQuery:function(a,b){a.searchQuery=b}},namespaced:!0,state:function(){return{activeProductListingIndex:1,listingQuery:"",searchQuery:""}}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Stores").ElasticSearch={actions:{elasticSearch:function(a,b){return a.commit("setElasticQuery",b),a.commit("setIsElasticSearchLoading",!0),new Promise(function(b,c){$.ajax({contentType:"application/json",data:JSON.stringify(a.getters.elasticSearchOptions),dataType:"json",headers:{authorization:"Bearer "+a.state.elasticKey},method:"POST",url:a.getters.elasticEndpoint+"/search"}).done(function(c){c&&(a.commit("setElasticSearchInfo",c.meta),a.commit("setElasticSearchResults",c.results),a.commit("setIsElasticSearchLoading",!0),c.meta&&a.commit("setElasticSearchTotalPage",Math.min(c.meta.page.total_pages,100))),b(c)}.bind(this)).fail(function(a){console.log(a),c(a)}).always(function(){a.commit("setIsElasticSearchLoading",!1)}.bind(this))})},setElasticEndpointBase:function(a,b){a.commit("setElasticEndpointBase",b)},setElasticEngineName:function(a,b){a.commit("setElasticEngineName",b)},setElasticKey:function(a,b){a.commit("setElasticKey",b)},setElasticSearchCurrentPage:function(a,b){a.commit("setElasticSearchCurrentPage",b)},setElasticSearchResultsPerPage:function(a,b){a.commit("setElasticSearchResultsPerPage",b)}},getters:{elasticEndpoint:function(a){return a.elasticEndpointBase+"/api/as/v1/engines/"+a.elasticEngineName},elasticSearchOptions:function(a){return{query:a.elasticQuery,page:{size:a.elasticSearchResultsPerPage,current:a.elasticSearchCurrentPage}}}},mutations:{setElasticEndpointBase:function(a,b){a.elasticEndpointBase=b},setElasticEngineName:function(a,b){a.elasticEngineName=b},setElasticKey:function(a,b){a.elasticKey=b},setIsElasticSearchLoading:function(a,b){a.isElasticSearchLoading=b},setElasticSearchCurrentPage:function(a,b){a.elasticSearchCurrentPage=b},setElasticSearchTotalPage:function(a,b){a.elasticSearchTotalPage=b},setElasticSearchInfo:function(a,b){a.elasticSearchInfo=b},setElasticSearchResults:function(a,b){a.elasticSearchResults=b},setElasticQuery:function(a,b){a.elasticQuery=b},setElasticSearchResultsPerPage:function(a,b){a.elasticSearchResultsPerPage=b}},namespaced:!0,state:function(){return{elasticSearchCurrentPage:1,elasticSearchTotalPage:0,elasticSearchInfo:null,elasticSearchResults:null,isElasticSearchLoading:!1,elasticSearchResultsPerPage:10,elasticEndpointBase:"",elasticEngineName:"",elasticKey:"",elasticQuery:""}}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Stores").MentalHealthQuiz={actions:{setSelectedModalId:function(a,b){a.commit("setSelectedModalId",b)}},getters:{},mutations:{setSelectedModalId:function(a,b){a.selectedModalId=b}},namespaced:!0,state:function(){return{selectedModalId:""}}}}(this),function(){Vue.directive("click-outside",{bind:function(a,b,c){a.event=function(d){document.body.contains(d.target)&&!a.contains(d.target)&&c.context[b.expression](d)},setTimeout(function(){document.body.addEventListener("click",a.event)},0)},unbind:function(a){document.body.removeEventListener("click",a.event)}})}(),function(a){"use strict";a.NR.resolve("SDM.Vue.Widgets").Tablist={data:function(){return{focusableElementsQuery:'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]'}},methods:{onKeyDown:function(a){if(!(this.selectedTabIndex<0||this.selectedTabIndex>=this.tabsLength)){var b=this.selectedTabIndex-1%this.tabsLength,c=this.selectedTabIndex+1%this.tabsLength;switch(a.key){case"ArrowLeft":this.$emit("setSelectedTabIndex",b),a.preventDefault();break;case"ArrowRight":this.$emit("setSelectedTabIndex",c),a.preventDefault();break;case"Home":this.$emit("setSelectedTabIndex",0),a.preventDefault();break;case"End":this.$emit("setSelectedTabIndex",this.tabsLength-1),a.preventDefault();break;default:return}Vue.nextTick(function(){this.$refs.tablist.querySelectorAll('[role="tab"]')[this.selectedTabIndex].focus()}.bind(this))}},toggleTabIndex:function(){Vue.nextTick(function(){for(var a=0;a=this.tabsLength?d.tabIndex=0:this.selectedTabIndex===a?(d.tabIndex=0,d.focus()):d.tabIndex=-1}}.bind(this))}},model:{prop:"selectedTabIndex",event:"setSelectedTabIndex"},mounted:function(){this.toggleTabIndex()},props:{tabsLength:{type:Number,default:0},selectedTabIndex:{type:Number,default:-1}},template:"#vue-widget-tablist",watch:{selectedTabIndex:function(a){(a>=0||a0&&(this.$refs.carousel.hasOwnProperty("slick")&&$(this.$refs.carousel).slick("unslick"),$(this.$refs.carousel).slick({arrows:0!==this.slides.length&&this.isArrowsVisible.desktop,autoplay:this.isAutoplay.desktop,autoplaySpeed:5e3,dots:0!==this.slides.length&&this.isPaginationVisible.desktop,infinite:!1,lazyLoad:"ondemand",responsive:[{breakpoint:this.breakpoints.tablet,settings:{arrows:0!==this.slides.length&&this.isArrowsVisible.tablet,autoplay:this.isAutoplay.tablet,dots:0!==this.slides.length&&this.isPaginationVisible.tablet,slidesToShow:this.slidesToShow.tablet}},{breakpoint:this.breakpoints.mobile,settings:{arrows:0!==this.slides.length&&this.isArrowsVisible.mobile,autoplay:this.isAutoplay.mobile,dots:0!==this.slides.length&&this.isPaginationVisible.mobile,slidesToShow:this.slidesToShow.mobile}}],slidesToScroll:1,slidesToShow:this.slidesToShow.desktop,swipeToSlide:!0}))},checkAvailability:function(a){this.setProductImageUrl(a.image?a.image.url:""),this.setProductHeading(a.title),this.setProductUpc(a.id),this.popUp.showPopUp()}}),components:{"product-tile":d.ProductTile},mixins:[c.Responsive],mounted:function(){ this.initializeCarousel()},props:{slides:{type:Array,default:[]},isArrowsVisible:{type:Object,default:function(){return{desktop:!0,tablet:!0,mobile:!0}}},isAutoplay:{type:Object,default:function(){return{desktop:!1,tablet:!1,mobile:!1}}},isControlsInset:{type:Object,default:function(){return{desktop:!1,tablet:!1,mobile:!1}}},isPaginationVisible:{type:Object,default:function(){return{desktop:!1,tablet:!1,mobile:!1}}},slidesToShow:{type:Object,default:function(){return{desktop:3,tablet:2,mobile:1}}},breakpoints:{type:Object,default:function(){return{tablet:769,mobile:480}}}},template:"#vue-widget-product-carousel",updated:function(){this.initializeCarousel()},watch:{}}}(this,this.jQuery),function(a,b){"use strict";var c=a.NR,d=c.resolve("SDM.Vue.Widgets"),e=c.resolve("SDM.Util"),f=a.moment,g=a.uuidv4,h=c.resolve("SDM.Data.Donation");d.Donation={computed:Object.assign({},Vuex.mapState("donation",["activePanel","moneyAmount","panels","pcOptimumAmount","address"]),{activeStepNumber:function(){if(!0===h.IsLinkOut)switch(this.activePanel){case this.panels.introduction:return 1;case this.panels.points:case this.panels.money:case this.panels.pcoptimum:return 2;case this.panels.confirmation:case this.panels.completion:return 3}else switch(this.activePanel){case this.panels.introduction:case this.panels.points:case this.panels.money:case this.panels.pcoptimum:return 1;case this.panels.address:return 2;case this.panels.confirmation:return 3;case this.panels.completion:return this.selectedDonationType===this.donationTypes.points?2:4}},moneyAmountValue:{get:function(){return this.moneyAmount},set:function(a){this.setMoneyAmount(a)}},numberOfSteps:function(){if(!0===h.IsLinkOut)switch(this.activePanel){case this.panels.introduction:return 0;case this.panels.points:case this.panels.money:case this.panels.pcoptimum:case this.panels.confirmation:return 3;case this.panels.completion:return 4}else switch(this.activePanel){case this.panels.introduction:return 0;case this.panels.points:return 2;case this.panels.money:return 4;case this.panels.pcoptimum:return 2;case this.panels.address:case this.panels.confirmation:return 4;case this.panels.completion:return this.selectedDonationType===this.donationTypes.points?2:4}},isMoneyAmountValid:function(){var a=/^\d*(\.\d{1,2})?$/;return""!==this.moneyAmount&&this.moneyAmount>=parseFloat(h.MinimumMoneyAmount)&&this.moneyAmount.search(a)>=0},isPCOptimumAmountValid:function(){var a=/^[1-9]\d*$/;return""!==this.pcOptimumAmount&&this.pcOptimumAmount>=parseFloat(h.MinimumPointAmount)&&this.pcOptimumAmount.search(a)>=0},pcOptimumAmountValue:{get:function(){return this.pcOptimumAmount},set:function(a){this.setPcOptimumAmount(a)}},addressValue:{get:function(){return this.address},set:function(a){this.setAddress(a)}}}),data:function(){return{donationTypes:{money:"money",points:"points"},formDateTime:f().utc().format("YYYY-MM-DDTHH:mm:ss")+"Z",formReferenceNumber:g(),formTransactionUUID:g(),isLoaderVisible:!1,isPCOptimumErrorVisible:!1,selectedDonationType:"",signature:""}},methods:Object.assign({},Vuex.mapActions("donation",["setActivePanel","setMoneyAmount","setPcOptimumAmount"]),{clearUrlParams:function(){var a="";a=-1===window.location.href.indexOf("?")?window.location.href:window.location.href.slice(0,window.location.href.indexOf("?")),history.pushState&&window.history.pushState("",null,a)},donatePCOptimumPoints:function(){this.isLoaderVisible=!0,b.ajax({context:this,data:{points:this.pcOptimumAmount},method:"POST",url:"/Brooklyn/Donate"}).done(function(a,c){if("success"===c&&"202"===a)this.setActivePanel(this.panels.completion);else{this.isPCOptimumErrorVisible=!0;var d=this.$refs.pcoPointsAmount;e.scrollTo$ElementAsync(b(d),500,this.scrollTopOffset+20),console.log("ERROR:"+a)}}).fail(function(a){this.isPCOptimumErrorVisible=!0;var c=this.$refs.pcoPointsAmount;e.scrollTo$ElementAsync(b(c),500,this.scrollTopOffset+20),console.log(a)}).always(function(){this.isLoaderVisible=!1})},getFormDataAsObject:function(a){for(var c=b(a).serializeArray(),d={},e=0;e0)for(var b=0;b0)}},created:function(){this.dropDownElId=this.uniqueIdPrefix+"_DropDown",this.query=this.initialValue},data:function(){return{cachedQuery:"",hasFocus:!1,selectedIndex:-1,query:""}},methods:{clearSuggestions:function(){this.selectedIndex=-1,this.$emit("clear")},decrementSelectedIndex:function(){if(!(this.isLoading||this.suggestions.length<=0)){var a=this.selectedIndex-1;a<-1&&(a=this.suggestions.length-1),this.selectedIndex=a}},focus:function(){this.$refs.input.focus()},incrementSelectedIndex:function(){if(!(this.isLoading||this.suggestions.length<=0)){var a=this.selectedIndex+1;a>this.suggestions.length-1&&(a=-1),this.selectedIndex=a}},makeLinkElId:function(a){return this.uniqueIdPrefix+"_Link_"+String(a)},onFocusChange:function(){setTimeout(_.bind(function(){var a=document.activeElement,b=_.some(this.$el.querySelectorAll("*"),function(b){return b===a});this.setHasFocus(b)},this),50)},onInput:function(){this.selectedIndex=-1,this.cachedQuery=null,this.query.length>2?this.$emit("fetch",this.query):this.clearSuggestions()},onLinkFocus:function(a){this.selectedIndex=a,this.onFocusChange()},onSubmit:function(a){this.query||a.preventDefault();var b=null;this.cachedQuery=this.query,this.selectedIndex>-1&&(b=(this.$refs.suggestionLinks||[])[this.selectedIndex])&&(a.preventDefault(),b.click()),this.clearSuggestions(),this.$emit("submit",a)},setHasFocus:function(a){this.hasFocus=a,this.cachedQuery=this.query}},props:{dropDownClass:{default:"",required:!1,type:String},dropDownTitle:{default:"",required:!1,type:String},formClass:{default:"",required:!1,type:String},initialValue:{default:"",required:!1,type:String},inputClass:{default:"",required:!1,type:String},isLoading:{default:!1,required:!1,type:Boolean},placeholder:{default:"",required:!1,type:String},submitLabel:{default:"",required:!0,type:String},suggestions:{default:function(){return[]},required:!0,type:Array},uniqueIdPrefix:{default:"",required:!0,type:String}},template:"#SearchWithAutocompleteTemplate",watch:{selectedIndex:function(){-1===this.selectedIndex?(this.query=this.cachedQuery||this.query,this.cachedQuery=null):(this.cachedQuery=this.cachedQuery||this.query,this.query=this.suggestions[this.selectedIndex].title)}}})}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Util"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Vue.Stores");d.StoreSelectorModal={components:{"pop-up":d.PopUp},computed:Object.assign({},Vuex.mapGetters("storeSelector",["selectedProduct"]),Vuex.mapState("storeSelector",["currentPaginationNumber","inventories","isStoreSelectorLoading","popUp","postalCode","selectedStore","stores"]),{firstPaginationNumber:function(){return Math.max(1,Math.min(this.currentPaginationNumber-1,this.maxPaginationNumber-2))},secondPaginationNumber:function(){return this.firstPaginationNumber+1},thirdPaginationNumber:function(){return this.firstPaginationNumber+2},maxPaginationNumber:function(){return this.stores.length>0?Math.ceil(this.searchResultCount/this.storesPerPage):1},postalCodeInput:{get:function(){return this.postalCode},set:function(a){this.setPostalCode(a)}},sortedStoreIdsByAvailability:function(){if(!this.selectedProduct)return[];var a={};for(var b in this.inventories)if(this.inventories.hasOwnProperty(b)){var c=this.inventories[b][this.selectedProduct.upc];c&&(a[b]=c)}return Object.keys(a).sort(function(b,c){return a[b]-a[c]})}}),data:function(){return{isRadiusDropdownActive:!1,isStoreSearchEmptyResult:!1,isStoreSearchInvalidPostalCode:!1,isStoreSelectorPopUpVisible:!1,lastSelectedProduct:null,radiusList:[3,5,10,20],searchLatitude:0,searchLongitude:0,selectedRadius:3,searchResultCount:0,storesPerPage:5}},methods:Object.assign({},Vuex.mapActions("storeSelector",["setCurrentPaginationNumber","setIsStoreSelectorLoading","setPopUp","setPostalCode","setSelectedStore","setStores"]),{initGeolocation:function(){var a=this.requrestGeolocation();$.when(a).then(_.bind(function(a){if(a){this.searchLatitude=a.lat,this.searchLongitude=a.lng;var b={latitude:this.searchLatitude,longitude:this.searchLongitude,radius:"3",unit:"km",lang:c.getShortLanguageCode(),lookup:"nearby",rpp:"5",isConsolePreorder:this.isConsolePreorder};this.setIsStoreSelectorLoading(!0),$.when(this.getStores(b)).done(_.bind(function(a){if(a){var b=JSON.parse(a);""===this.postalCodeInput&&b.results.length>0&&(this.postalCodeInput=b.results[0].postalCode,this.setSelectedStore(b.results[0]),sessionStorage.setItem("selected_store_latlng",JSON.stringify({lat:b.results[0].latitude,lng:b.results[0].longitude})),this.setStores(b.results),this.searchResultCount=b.count)}},this)).fail(function(a){console.log(a)}).always(function(){this.setIsStoreSelectorLoading(!1)}.bind(this))}},this))},requrestGeolocation:function(){var a=$.Deferred(),b=JSON.parse(sessionStorage.getItem("selected_store_latlng"));return b?a.resolve(b):navigator.geolocation?navigator.geolocation.getCurrentPosition(function(b){a.resolve({lat:b.coords.latitude,lng:b.coords.longitude})},function(b){console.log(b),a.resolve(null)}):a.resolve(null),a.promise()},onPostalCodeSubmit:function(){this.isRadiusDropdownActive=!1,this.setIsStoreSelectorLoading(!0),c.validatePostalCode(this.postalCodeInput)?(this.isStoreSearchEmptyResult=!1,this.isStoreSearchInvalidPostalCode=!1,$.when(c.loadGoogleMapsApi()).then(_.bind(function(){this.geocoder=new a.google.maps.Geocoder,this.geocoder.geocode({address:this.postalCodeInput},_.bind(this.geocoderCallback,this))},this))):(this.isStoreSearchInvalidPostalCode=!0,this.setIsStoreSelectorLoading(!1))},geocoderCallback:function(b,d){if(d===a.google.maps.GeocoderStatus.OK){var e=b[0].geometry.location;this.setCurrentPaginationNumber(1),this.searchLatitude=e.lat(),this.searchLongitude=e.lng();var f={latitude:e.lat(),longitude:e.lng(),radius:this.selectedRadius,unit:"km",lang:c.getShortLanguageCode(),lookup:"nearby",rpp:this.storesPerPage,productId:this.selectedProduct?this.selectedProduct.upc:null,isConsolePreorder:this.isConsolePreorder};this.setIsStoreSelectorLoading(!0),$.when(this.getStores(f)).done(_.bind(function(a){if(a){var b=JSON.parse(a);b.results.length>0?(this.setStores(b.results),this.searchResultCount=b.count):this.isStoreSearchEmptyResult=!0,this.setIsStoreSelectorLoading(!1),this.lastSelectedProduct=this.selectedProduct}},this)).fail(function(a){console.log(a)}).always(function(){this.setIsStoreSelectorLoading(!1)}.bind(this))}else this.isStoreSearchEmptyResult=!0,this.setIsStoreSelectorLoading(!1)},getInventoryFromStoreNumber:function(a){return this.inventories&&this.inventories[a]&&this.inventories[a][this.selectedProduct.upc]?this.inventories[a][this.selectedProduct.upc]:0},getUrlParametersAsObject:function(a){return JSON.parse('{"'+decodeURI(a).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')},getStores:function(a){return $.ajax({method:"GET",url:"/sdmapi/store/getstores",data:a})},getStoresByIds:function(){$.ajax({method:"GET",url:"/"+c.getShortLanguageCode()+"/store/getstoresbyids",data:{storeids:this.sortedStoreIdsByAvailability.slice((this.currentPaginationNumber-1)*this.storesPerPage,this.storesPerPage).join(",")}}).done(_.bind(function(a){console.log(a)},this)).fail(function(a){console.log(a)})},goToPage:function(a){this.setIsStoreSelectorLoading(!0);var b={isConsolePreorder:this.isConsolePreorder,lang:c.getShortLanguageCode(),latitude:this.searchLatitude,longitude:this.searchLongitude,lookup:"nearby",page:a,productId:this.selectedProduct?this.selectedProduct.upc:null,radius:this.selectedRadius,rpp:this.storesPerPage,unit:"km"};$.when(this.getStores(b)).done(_.bind(function(a){if(a){var b=JSON.parse(a);b.results.length>0?(this.setStores(b.results),this.searchResultCount=b.count):this.isStoreSearchEmptyResult=!0,this.setIsStoreSelectorLoading(!1),this.lastSelectedProduct=this.selectedProduct}},this)).fail(function(a){console.log(a)}).always(function(){this.setIsStoreSelectorLoading(!1)}.bind(this)),this.setCurrentPaginationNumber(a)},registerStoreModule:function(){this.$store.hasModule("storeSelector")||this.$store.registerModule("storeSelector",e.StoreSelector)},selectStore:function(a){this.setSelectedStore(a),sessionStorage.setItem("selected_store_latlng",JSON.stringify({lat:a.latitude,lng:a.longitude})),this.postalCodeInput=a.postalCode,this.popUp.hidePopUp(),this.onPostalCodeSubmit()},setSelectedRadius:function(a){this.selectedRadius=a},sortByDistance:function(){this.setCurrentPaginationNumber(1),this.isSortByInventory=!1,this.onPostalCodeSubmit()},sortByAvailability:function(){this.setCurrentPaginationNumber(1),this.isSortByInventory=!0,this.onPostalCodeSubmit()}}),mounted:function(){this.registerStoreModule(),this.setPopUp(this.$refs.popUpStoreSelector),this.initGeolocation(),""!==this.postalCodeInput&&this.onPostalCodeSubmit()},props:{isConsolePreorder:{type:Boolean,default:!1}},template:"#vue-widget-store-selector-modal",watch:{selectedProduct:function(){this.selectedProduct!==this.lastSelectedProduct&&""!==this.postalCodeInput&&this.onPostalCodeSubmit()}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Widgets"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Mixins");c.StoreSelector={components:{"store-selector-modal":c.StoreSelectorModal},computed:Object.assign({},Vuex.mapState("storeSelector",["popUp","selectedStore"]),{}),data:function(){return{isStoreInfoVisible:!1}},methods:Object.assign({},Vuex.mapActions("storeSelector",["setProductImageUrl","setProductHeading","setProductSubheading","setProductUpc","setSelectedStore"]),{hideStoreInfo:function(){this.isStoreInfoVisible=!1},onSelectStoreClick:function(){this.setProductImageUrl(""),this.setProductHeading(""),this.setProductSubheading(""),this.setProductUpc(""),this.popUp.showPopUp()},registerStoreModule:function(){this.$store.hasModule("storeSelector")||this.$store.registerModule("storeSelector",d.StoreSelector)}}),mixins:[e.Responsive],mounted:function(){this.registerStoreModule()},props:{colorPrimary:{type:String,default:""},colorSecondary:{type:String,default:""},isMinimalOnMobile:{type:Boolean,default:!1},icon:{type:String,default:"/static/core/images/icon-pin-small.png"}},template:"#vue-widget-store-selector"}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Widgets"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Mixins"),f=b.resolve("SDM.Util");c.ProvinceSelector={created:function(){document.addEventListener("click",function(a){this.$refs.refProvinceSelector&&!this.$refs.refProvinceSelector.contains(a.target)&&(this.isProvinceSelectorActive=!1)}.bind(this))},components:{},computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"])),data:function(){return{isProvinceSelectorActive:!1,pronviceFromApi:""}},methods:Object.assign({},Vuex.mapActions("provinceSelector",["setUserProvinceId"]),{registerStoreModule:function(){this.$store.hasModule("provinceSelector")||this.$store.registerModule("provinceSelector",d.provinceSelector)}, selectUserProvinceId:function(a){f.saveCookie("user-selected-province-id",a),this.isProvinceSelectorActive=!1,this.model.provinceSelectorSettings&&this.model.provinceSelectorSettings.refreshPageOnSelect?location.reload(!0):this.setUserProvinceId(a)},initGeolocation:function(){var a=JSON.parse(sessionStorage.getItem("current-geolocation"));if(a&&Object.keys(a).length>0)this.searchProvinceId(a);else{var b=this.requrestGeolocation();$.when(b).then(_.bind(function(a){if(a){var b={lat:a.lat,lng:a.lng};sessionStorage.setItem("current-geolocation",JSON.stringify(b)),this.searchProvinceId(b)}},this))}},searchProvinceId:function(b){$.when(f.loadGoogleMapsApi()).done(function(){this.geocoder=new a.google.maps.Geocoder,this.geocoder.geocode({location:b},_.bind(this.geocoderCallback,this))}.bind(this)).fail(function(){this.setSdmLocation()}.bind(this))},requrestGeolocation:function(){var a=this,b=$.Deferred();return navigator.geolocation?navigator.geolocation.getCurrentPosition(function(a){b.resolve({lat:a.coords.latitude,lng:a.coords.longitude})},function(){a.setSdmLocation(),b.resolve(null)}):b.resolve(null),b.promise()},geocoderCallback:function(b,c){var d=this;if(c===a.google.maps.GeocoderStatus.OK){b[0].address_components.map(function(a){a.types.includes("administrative_area_level_1")&&(d.pronviceFromApi=a.short_name)});-1!==this.model.provinces.findIndex(function(a){return a.abbreviation.toUpperCase()===this.pronviceFromApi}.bind(this))?this.setUserProvinceId(this.pronviceFromApi):this.setSdmLocation()}},setSdmLocation:function(){var a=-1!==this.model.provinces.findIndex(function(a){return a.abbreviation.toUpperCase()===this.userProvinceId.toUpperCase()}.bind(this)),b=-1!==this.model.provinces.findIndex(function(a){return"ON"===a.abbreviation.toUpperCase()}.bind(this)),c=-1!==this.model.provinces.findIndex(function(a){return"QC"===a.abbreviation.toUpperCase()}.bind(this));a||(f.isPhx()&&c?this.setUserProvinceId("QC"):!f.isPhx()&&b?this.setUserProvinceId("ON"):this.setUserProvinceId(this.provinces[0].abbreviation.toUpperCase()))}}),mixins:[e.Responsive],mounted:function(){if(this.registerStoreModule(),this.model.provinces){this.setSdmLocation();var a=f.getValueFromCookie("user-selected-province-id");a?(this.setUserProvinceId(a.toUpperCase()),this.setSdmLocation()):this.initGeolocation()}},props:{model:{type:Object,required:!0}},template:"#vue-widget-province-selector"}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Widgets"),f=b.resolve("SDM.Data.Apple");c.Apple=function(){var a=new Vuex.Store({modules:{storeSelector:d.StoreSelector}}),b={methods:{findObjectByKey:function(a,b,c){for(var d=0;d640?(this.isMenuOpen=!1,TweenLite.to(this.navigationContainer,.3,{height:"68px"})):(this.isMenuOpen=!1,TweenLite.to(this.navigationContainer,.3,{height:"62px"}))}},watch:{$route:function(){this.isMenuOpen=!1,window.innerWidth<641&&TweenLite.to(this.navigationContainer,.3,{height:"59px"})}}});var h={template:"#module-apple-home-template",mounted:function(){this.$el.style.opacity=0,TweenLite.to(this.$el,.5,{opacity:1,delay:.6})}},i={template:"#module-apple-products-grid-template",mixins:[b],props:{discoverMore:String},data:function(){return{productsArrayData:[],productsArray:[]}},mounted:function(){this.productsArrayData=this.findObjectByKey(f.Tabs,"TabFriendlyUrlName",this.$route.fullPath.split("/")[1]).Products,this.initProductsArrayData()},methods:Object.assign({},Vuex.mapActions("storeSelector",["setInventories","setProductImageUrl","setProductHeading","setProductSubheading","setProductUpc"]),{initProductsArrayData:function(){for(var a=0;a0&&(this.productImages=this.productData.Assets),this.initProductData()},methods:Object.assign({},Vuex.mapActions("storeSelector",["setProductImageUrl","setProductHeading","setProductSubheading","setProductUpc"]),{initProductData:function(){this.productImages.length>0?(this.currentImage=this.productImages[this.currentImageIndex],this.product.imageSrc=this.productImages[0].Url):(this.currentImage="",this.product.imageSrc=""),this.product.id=this.productData.UpcStripped,this.product.title=this.productData.Content.Title,this.product.subTitle=this.productData.Content.SupplementTitleText,this.product.upc=this.productData.UpcStripped,this.productBuyNowLink=this.productData.BuyNowLink,this.product.description=this.productData.Content.Description},thumbnailClick:function(a){this.currentImageIndex=a,this.currentImage=this.productImages[this.currentImageIndex]},checkAvailability:function(a){this.setProductImageUrl(a.imageSrc),this.setProductHeading(a.title),this.setProductUpc(a.upc),this.popUp.showPopUp()}}),computed:Object.assign({},Vuex.mapState("storeSelector",["inventories","popUp","selectedStore"]))};Vue.component("products-grid",i),Vue.component("product-details",j),Vue.component("store-selector",e.StoreSelector);for(var k=[{path:"/",components:{mainContent:h}}],l=0;lk}},created:function(){var a=97,b=a+26;this.debouncedFetchSuggestions=d.debounce(this.fetchSuggestions,500),this.conditionsByChar=d.reduce(g.Conditions,function(a,b){return a[b.key]=b.conditions,a},{}),this.filterChars=d.map(d.range(a,b),function(a){return String.fromCodePoint(a)})},data:function(){return{currentSuggestionsRequest:null,filterChar:null,isLoadingSuggestions:!1,isShowFilteredConditions:!1,searchSuggestions:[]}},el:a.get(0),methods:{cancelSuggestionsRequest:function(){this.currentRequest&&this.currentRequest.abort&&(this.currentRequest.abort(),this.isLoadingSuggestions=!1)},fetchSuggestions:function(a){a.length&&(this.cancelSuggestionsRequest(),this.isLoadingSuggestions=!0,this.currentRequest=c.ajax({type:"GET",url:"/"+i.getShortLanguageCode()+"/search/getstructuredsearch",data:{numRes:15,query:a,type:"Condition"},success:d.bind(function(a){this.isLoadingSuggestions=!1,this.searchSuggestions=d.map(a.StructuredResult[0].Result.records.page,function(a){return{title:a.title,url:a.url}})},this)}))},onClearSearch:function(){this.searchSuggestions=[],this.cancelSuggestionsRequest()},setFilterChar:function(a){this.isShowFilteredConditions=!1,this.filterChar=a},showFilteredConditions:function(){this.isShowFilteredConditions=!0}}})}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Data.ConsolePreorderBanner");c.ConsolePreorderBanner=function(){new Vue({data:function(){return{isLoading:!0,isSoldOut:!0}},el:"#module-console-preorder-banner",mounted:function(){this.isLoading=!0,$.ajax({contentType:"application/json",data:JSON.stringify({Brand:d.Brand}),dataType:"json",headers:{__RequestVerificationToken:d.VerificationToken},method:"POST",url:"/consolepreorder/GetPreorderStock"}).done(function(a){var b=a;Object.keys(b).forEach(function(a){b[a]&&(this.isSoldOut=!1)}.bind(this))}.bind(this)).fail(function(a){console.log(a)}).always(function(){this.isLoading=!1}.bind(this))}})}}(this),function(a){a.NR.resolve("SDM.Vue.Modules.ConsolePreorder.VueComponents").ProgressBar={name:"ProgressBar",props:{currentStep:{type:Number,default:1},totalSteps:{type:Number,default:4}},template:"#module-console-preorder-progress-bar"}}(this),function(a,b){var c=a.NR,d=c.resolve("SDM.Vue.Modules.ConsolePreorder.VueComponents"),e=c.resolve("SDM.Util"),f=c.resolve("SDM.Vue.Widgets"),g=c.resolve("SDM.Data.ConsolePreorder");d.Reservation={components:{"pop-up":f.PopUp,"progress-bar":d.ProgressBar,"store-selector-modal":f.StoreSelectorModal},computed:Object.assign({},Vuex.mapState("storeSelector",["popUp","postalCode","selectedStore"]),{cartLength:function(){return Object.keys(this.cart).length},postalCodeInput:{get:function(){return this.postalCode},set:function(a){this.setPostalCode(a)}},totalProductPrice:function(){var a=0,b=e.getShortLanguageCode(),c=Object.keys(this.cart);for(var d in c){var f=c[d];a+=parseFloat(this.cart[f])}var g=a.toFixed(2).split("."),h=g[0],i=g[1];return"en"===b?"$"+(h=h.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"))+"."+i:"fr"===b?(h=h.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1 "))+","+i+" $":void 0}}),data:function(){return{cart:{},cartOutOfStock:{},consentConsole:!1,consentNewsletter:!1,currentStep:1,email:"",firstName:"",isLoading:!1,isNotificationSubscribed:!1,lastName:"",selectedConsole:"",selectedProductDetailKey:"",selectedProductNotificationKey:"",stockAvailability:{},totalSteps:4}},methods:Object.assign({},Vuex.mapActions("storeSelector",["setPostalCode"]),{checkConsoleConsent:function(){this.consentConsole?this.$refs.formConsoleConsent.setCustomValidity(""):this.$refs.formConsoleConsent.setCustomValidity(g.ConsentCheckboxErrorMessage)},checkEmail:function(){e.validateEmail(this.email)?(this.$refs.formEmail&&this.$refs.formEmail.setCustomValidity(""),this.$refs.formStockNotificationEmail&&this.$refs.formStockNotificationEmail.setCustomValidity(""),this.$refs.formProductNotificationEmail&&this.$refs.formProductNotificationEmail.setCustomValidity("")):(this.$refs.formEmail&&this.$refs.formEmail.setCustomValidity(g.EmailErrorMessage),this.$refs.formStockNotificationEmail&&this.$refs.formStockNotificationEmail.setCustomValidity(g.EmailErrorMessage),this.$refs.formProductNotificationEmail&&this.$refs.formProductNotificationEmail.setCustomValidity(g.EmailErrorMessage))},checkFirstName:function(){""===this.firstName?this.$refs.formFirstName.setCustomValidity(g.FirstNameErrorMessage):this.$refs.formFirstName.setCustomValidity("")},checkLastName:function(){""===this.lastName?this.$refs.formLastName.setCustomValidity(g.LastNameErrorMessage):this.$refs.formLastName.setCustomValidity("")},checkPostalCode:function(){return e.validatePostalCode(this.postalCodeInput)?(this.$refs.formPostalCode.setCustomValidity(""),!0):(this.$refs.formPostalCode.setCustomValidity(g.PostalCodeErrorMessage),!1)},closeUsedEmailPopUp:function(){this.$refs.popUpUsedEmail.hidePopUp()},getStockStatus:function(){b.ajax({contentType:"application/json",data:JSON.stringify({Brand:g.Brand}),dataType:"json",headers:{__RequestVerificationToken:g.VerificationToken},method:"POST",url:"/consolepreorder/GetPreorderStock"}).done(function(a){this.stockAvailability=a}.bind(this)).fail(function(a){console.log(a)}).always(function(){this.isLoading=!1}.bind(this))},goBack:function(){1===this.currentStep?this.$router.go(-1):this.currentStep-=1,e.scrollTo$ElementAsync(b(this.$refs.reservation),500)},proceedFromStepOne:function(){this.currentStep+=1,e.scrollTo$ElementAsync(b(this.$refs.reservation),500)},proceedFromStepTwo:function(){this.$refs.popUpStock.hidePopUp(),this.checkConsoleConsent(),this.checkEmail(),this.checkFirstName(),this.checkLastName(),this.$refs.formPickup.checkValidity()?(this.consentNewsletter&&this.subscribeNewsletter(),this.sendPreorder()):this.$refs.formPickup.reportValidity()},searchStore:function(){this.$refs.formStoreSelector&&!this.$refs.formStoreSelector.checkValidity()?this.$refs.formStoreSelector.reportValidity():(this.popUp.showPopUp(),this.$refs.storeSelectorModal.onPostalCodeSubmit())},sendPreorder:function(){this.isLoading=!0;var a={Brand:g.Brand,Email:this.email,FirstName:this.firstName,LastName:this.lastName,CASLValue:g.CASLValue,LangCode:e.getFullLanguageCode(),IsSDM:g.IsSDM,SdmPromotion:this.consentNewsletter,StoreID:this.selectedStore.storeNumber};Object.keys(this.cart).forEach(function(b){a[b]=!0}),b.ajax({contentType:"application/json",data:JSON.stringify(a),dataType:"json",headers:{__RequestVerificationToken:g.VerificationToken},method:"POST",url:"/consolepreorder/preorder"}).done(function(a){"OK"===a.Status&&"Queued"===a.Message?(this.currentStep+=1,e.scrollTo$ElementAsync(b(this.$refs.reservation),500)):"FAIL"===a.Status&&"Confirmed"===a.Message?this.$refs.popUpUsedEmail.showPopUp():"FAIL"===a.Status&&"PendingValidation"===a.Message?this.$refs.popUpPendingEmail.showPopUp():"FAIL"===a.Status&&"OutOfStock"===a.Message&&(this.cartOutOfStock=[],Object.keys(this.cart).forEach(function(b){!1===a.Stock[b]&&(this.selectedConsole===b&&(this.selectedConsole=""),this.$set(this.cartOutOfStock,b,this.cart[b]),this.$delete(this.cart,b))}.bind(this)),this.stockAvailability=a.Stock,this.isNotificationSubscribed=!1,this.$refs.popUpStock.showPopUp(),0===this.cartLength&&this.goBack())}.bind(this)).fail(function(a){console.log(a)}).always(function(){this.isLoading=!1}.bind(this))},showProductDetail:function(a){this.selectedProductDetailKey=a,this.$refs.popUpProductDetail.showPopUp()},showProductNotification:function(a){this.isNotificationSubscribed=!1,this.selectedProductNotificationKey=a,this.$refs.popUpProductNotification.showPopUp()},subscribeNewsletter:function(){b.ajax({context:this,cache:!1,contentType:"application/x-www-form-urlencoded",type:"POST",url:"/subscribe",data:{email:this.email,casl:""},headers:{__RequestVerificationToken:g.VerificationToken}}).done(function(a){"True"!==a&&console.log(err)}).fail(function(a){console.log(a)})},subscribeNotification:function(a){this.isLoading=!0;var c={Brand:g.Brand,Email:this.email,CASLValue:g.CASLValue,LangCode:e.getFullLanguageCode(),IsSDM:g.IsSDM};a.forEach(function(a){c[a]=!0}),b.ajax({contentType:"application/json",data:JSON.stringify(c),dataType:"json",headers:{__RequestVerificationToken:g.VerificationToken},method:"POST",url:"/consolepreorder/subscribe"}).done(function(a){"OK"===a.Status&&"Queued"===a.Message&&(this.isNotificationSubscribed=!0)}.bind(this)).fail(function(a){console.log(a)}).always(function(){this.isLoading=!1}.bind(this))},subscribeOutOfStockCart:function(){if(this.$refs.formStockNotification&&!this.$refs.formStockNotification.checkValidity())this.$refs.formStockNotification.reportValidity();else{var a=Object.keys(this.cartOutOfStock);this.subscribeNotification(a)}},subscribeProductNotification:function(){if(this.$refs.formProductNotification&&!this.$refs.formProductNotification.checkValidity())this.$refs.formProductNotification.reportValidity();else{var a=[];a.push(selectedProductNotificationKey),this.subscribeNotification(a)}},toggleConsole:function(a,b){""===this.selectedConsole?(this.selectedConsole=a,this.toggleProductInCart(a,b)):this.selectedConsole!==a?(this.toggleProductInCart(this.selectedConsole,this.cart[this.selectedConsole]),this.toggleProductInCart(a,b),this.selectedConsole=a):(this.selectedConsole="",this.toggleProductInCart(a,b))},toggleProductInCart:function(a,b){void 0===this.cart[a]?this.$set(this.cart,a,b):this.$delete(this.cart,a),0===Object.keys(this.cart).length&&1!==this.currentStep&&this.goBack()}}),mounted:function(){this.isLoading=!0,this.getStockStatus();var a=parseInt(g.StockCheckFrequency);a>=0&&setInterval(function(){this.getStockStatus()}.bind(this),a)},name:"Reservation",template:"#module-console-preorder-reservation"}}(this,this.jQuery),function(a){a.NR.resolve("SDM.Vue.Modules.ConsolePreorder.VueComponents").Update={mounted:function(){},name:"Update",template:"#module-console-preorder-update"}}(this),function(a,b){var c=a.NR,d=c.resolve("SDM.Vue.Modules"),e=c.resolve("SDM.Vue.Modules.ConsolePreorder.VueComponents"),f=c.resolve("SDM.Vue.Stores");d.ConsolePreorder=function(){var a=new Vuex.Store({modules:{storeSelector:f.StoreSelector,consolePreorder:{}}}),c=new VueRouter({base:b("#module-console-preorder").data("module-console-preorder-base"),mode:"history",routes:[{component:e.Reservation,name:"reservation",path:"/"},{component:e.Update,name:"update",path:"/update"}]});new Vue({el:"#module-console-preorder",mounted:function(){},router:c,store:a})}}(this,this.jQuery),function(a){a.NR.resolve("SDM.Vue.Modules").FaqSection=function(a){new Vue({data:function(){return{openIndex:-1}},el:a.get(0),methods:{closeItem:function(a,b){function c(){var f=parseInt(a.style.maxHeight,10),g=f+e;e*=.95,a.style.maxHeight=String(Math.max(0,g))+"px",g>0?window.requestAnimationFrame(c):(a.style.maxHeight=String(d)+"px",b())}var d=a.offsetHeight,e=0-a.offsetHeight/15;a.style.maxHeight=d+"px",window.requestAnimationFrame(c)},openItem:function(a,b){function c(){var f=parseInt(a.style.maxHeight,10),g=f+e;e*=.95,a.style.maxHeight=String(g)+"px",g0,c=h.getUrlVars();this.isUserProvinceIdAvailable&&c&&"true"===c.book&&!a&&(delete c.book,h.setUrlVars(c),this.showPopUp())},onBackClick:function(){this.isSubmissionCompleted=!1,this.isSubmissionFailed=!1},onSubmitBookingClick:function(a){this.$refs.formAppointment.checkValidity()?(this.isLoading=!0,b.ajax({data:{FirstName:this.formFirstName,LastName:this.formLastName,PhoneNumber:this.formPhoneNumber,EmailAddress:this.formEmail,Province:this.formProvince,PreferredLanguage:this.formLanguage,LangCode:i.LanguageCode},headers:{__RequestVerificationToken:i.AntiForgeryToken},method:"POST",url:"/dietitian/SubmitBooking"}).done(function(a){a&&202===a.StatusCode?this.isSubmissionCompleted=!0:this.isSubmissionFailed=!0}.bind(this)).fail(function(a){console.log(a),this.isSubmissionFailed=!0}).always(function(){this.isLoading=!1}.bind(this))):(this.isInvalidSymbolVisible=!0,this.$refs.formAppointment.reportValidity()),a.preventDefault()},onOkClick:function(){this.$refs.popUpBookAppointment.hidePopUp()},showPopUp:function(){this.formEmail="",this.formFirstName="",this.formLanguage="",this.formLastName="",this.formPhoneNumber="",this.formProvince="",this.isSubmissionCompleted=!1,this.isSubmissionFailed=!1,this.isInvalidSymbolVisible=!1,this.$refs.popUpBookAppointment.showPopUp()}},mounted:function(){this.provinces=i.Provinces.map(function(a){return{abbreviation:a.Abbreviation.toUpperCase(),title:a.Title}}),this.handleUrlParam()},store:j})}}(this,jQuery),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Widgets"),f=b.resolve("SDM.Util");c.FindInStore=function(a){var c=a.data("contentId"),g=b.resolve("SDM.Data.FindInStore")[c],h=new Vuex.Store({modules:{elasticSearch:d.ElasticSearch,storeSelector:d.StoreSelector,findInStore:d.FindInStore}}),i=new VueRouter({base:"/"+f.getShortLanguageCode()+"/find-in-store/",mode:"history",routes:[{component:e.FindInStoreListing,name:"listing",path:"/",props:{powerReviewsApiKey:g.PowerReviewsApiKey,powerReviewsMerchantId:g.PowerReviewsMerchantId,powerReviewsMerchantGroupId:g.PowerReviewsMerchantGroupId,powerReviewsLocale:g.PowerReviewsLocale}},{component:e.FindInStoreProduct,name:"product",path:"/product/:titleSlug/:upc",props:{elasticEndpointBase:g.ElasticEndpointBase,elasticEngineName:g.ElasticEngineName,elasticKey:g.ElasticKey,isCompactStyle:g.IsProductDetailsCompactStyle}}]});new Vue({components:{"find-in-store-search":e.FindInStoreSearch,"store-selector":e.StoreSelector},computed:Object.assign({},{}),data:function(){return{}},el:a[0],methods:Object.assign({},{}),mounted:function(){},router:i,store:h})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Mixins"),d=b.resolve("SDM.Vue.Modules"),e=b.resolve("SDM.Vue.Widgets"),f=b.resolve("SDM.Vue.Stores");d.LoveYouDonation=function(){var a=new Vuex.Store({modules:{donation:f.Donation}});new Vue({components:{donation:e.Donation},el:"#module-love-you-donation",mixins:[c.Responsive],store:a})}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.P32021.VueComponents").BadgeCta={computed:{},data:function(){return{}},methods:{},mounted:function(){},props:{badge:{type:Object,default:null}},template:"#module-p3-2021-badge-cta",updated:function(){},watch:{}}}(this,this.jQuery),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.P32021.VueComponents").FooterMenu={computed:{},data:function(){return{}},methods:{},mounted:function(){},props:{},template:"#module-p3-2021-footer",updated:function(){},watch:{}}}(this,this.jQuery),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.P32021.VueComponents"),d=b.resolve("SDM.Util");c.GameSelector={computed:{},data:function(){return{}},methods:Object.assign({},Vuex.mapActions("p32021",["setGameScore","setIsGameCompleted"]),{resetCookie:function(){this.setGameScore(0),this.setIsGameCompleted(!1),d.saveCookie("p32021game","{}")}}),mounted:function(){},props:{heading:{type:String,default:""},productImages:{type:Array,default:function(){return[]}},cta:{type:Object,default:null}},template:"#module-p3-2021-game-selector",updated:function(){},watch:{}}}(this,this.jQuery),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.P32021.VueComponents"),d=b.resolve("SDM.Data.P32021");c.Game={computed:Object.assign({},Vuex.mapState("p32021",["gameScore","isGameCompleted"]),{}),data:function(){return{gamePieceLayer:null,playfieldLayer:null,productsLayer:null,gameOverLayer:null,indicatorLayer:null,world:null,gamePieces:[],pegs:[],width:480,height:640,scale:40,radiusDisk:.65,colors:[],defaultFillColor:null,specialFillColor:null,defaultStrokeColor:null,specialStrokeColor:null,drawDebugData:!1,addStats:!1,pointTextObject:null,currentPlayerPoints:0,ballsLeftInitial:3,ballsLeft:3,indicatorGamePiece:null,assets:{},target:1,locale:"en",tl:"",Util:{},SfxInterface:"",selectedGoalProduct:0,products:{}}},methods:Object.assign({},Vuex.mapActions("p32021",["setGameScore","setIsGameCompleted"]),{initDropToWinGame:function(){var a=this;this.ballsLeft=this.gameChances,this.setImageAssets(this.products);var b=0,c={containerId:"canvasContainer",layers:[{name:"canvasDropToWinBackground",x:0,y:0,width:480,height:640,zIndex:b++,backgroundColor:"#aa1651"},{name:"canvasDropToWinProducts",x:0,y:0,width:480,height:640,zIndex:b++},{name:"canvasDropToWinPlayfield",x:0,y:0,width:480,height:640,zIndex:b++},{name:"canvasDropToWinGamePieceLayer",x:0,y:0,width:480,height:640,zIndex:b++},{name:"canvasDropToWinBox2dDebug",x:0,y:0,width:480,height:640,zIndex:b++},{name:"canvasDropToWinIndicatorLayer",x:0,y:0,width:480,height:640,zIndex:b++},{name:"canvasDropToWinMouseHit",x:0,y:0,width:480,height:640,zIndex:b++,clickCallback:a.onGameStart,mouseHitId:"canvasMouseHitDetector"}]};if(document.StratiscapeDraw=new Stratiscape(c),document.StratiscapeDraw.canvasSupported){var d=document.StratiscapeDraw.getLayer("canvasDropToWinPlayfield"),e=document.StratiscapeDraw.getLayer("canvasDropToWinGamePieceLayer"),f=document.StratiscapeDraw.getLayer("canvasDropToWinBackground"),g=document.StratiscapeDraw.getLayer("canvasDropToWinBox2dDebug"),h=document.StratiscapeDraw.getLayer("canvasDropToWinProducts"),i=document.StratiscapeDraw.getLayer("canvasDropToWinIndicatorLayer");this.Setup("en",d,e,f,g,h,i)}else $("#canvasContainer").html('

Bummer! Your browser does not support the HTML 5 Canvas Tag!

');this.WinnerText=new this.WinnerText(a.width/2,a.height/2,a.winnerTextUrl),this.indicatorLayer.addChild(a.WinnerText),this.setTarget(a.selectedGoalProduct),this.updateAllImages()},handleKeyDown:function(a){this&&this.$el&&window.document.contains(this.$el)&&32===a.keyCode&&(a.preventDefault(),this.onGameStart())},setScore:function(a){a>=0&&a<=5&&this.setGameScore(this.gameScore+a)},gameOver:function(){this.setIsGameCompleted(!0)},setImageAssets:function(a){this.assets=a},getImageAsset:function(a){return this.assets[a]},Setup:function(a,b,c,d,e,f,g){this.locale=a;var h=this;this.SfxInterface=new SfxInterface(["/static/core/sounds/p3-2021/WoodBlHiExtraPercV1.wav","/static/core/sounds/p3-2021/WoodBlHiExtraPercV2.wav","/static/core/sounds/p3-2021/WoodBlHiExtraPercV3.wav","/static/core/sounds/p3-2021/WoodBlHiOrchPercV1.wav","/static/core/sounds/p3-2021/points.wav","/static/core/sounds/p3-2021/VibraSlapExtraPercV1.wav","/static/core/sounds/p3-2021/highpoints.wav","/static/core/sounds/p3-2021/winner.mp3","/static/core/sounds/p3-2021/ClaveMetamorphic.wav"]),this.SfxInterface.setVolume(.5),this.SfxInterface.setVolumeAt(0,.1),this.SfxInterface.setVolumeAt(1,.1),this.SfxInterface.setVolumeAt(2,.1),this.SfxInterface.setVolumeAt(3,.2),this.colors.push(new h.Util.ColorRGBA(255,255,255,255)),this.colors.push(new h.Util.ColorRGBA(255,255,0,255)),this.colors.push(new h.Util.ColorRGBA(255,165,0,255)),this.colors.push(new h.Util.ColorRGBA(0,0,255,255)),this.colors.push(new h.Util.ColorRGBA(0,128,0,255)),this.colors.push(new h.Util.ColorRGBA(255,0,0,255)),this.colors.push(new h.Util.ColorRGBA(128,0,128,255)),this.defaultFillColor=new h.Util.ColorRGBA(163,23,79,255),this.specialFillColor=new h.Util.ColorRGBA(246,0,255,255),this.defaultStrokeColor=new h.Util.ColorRGBA(251,219,99,255),this.specialStrokeColor=new h.Util.ColorRGBA(22,44,12,255);var i=.1,j=this.width/this.scale,k=this.height/this.scale,l=k-i,m=Box2D.Common.Math.b2Vec2,n=Box2D.Dynamics.b2BodyDef,o=Box2D.Dynamics.b2FixtureDef,p=Box2D.Dynamics.b2World,q=Box2D.Collision.Shapes.b2PolygonShape,r=Box2D.Collision.Shapes.b2CircleShape,s=Box2D.Dynamics.b2DebugDraw,t=new o;t.density=1,t.friction=.1,t.restitution=.1;var u=new n;this.world=new p(new m(0,30),!0),this.playfieldLayer=b,this.gamePieceLayer=c,this.productsLayer=f,this.backgroundLayer=d,this.indicatorLayer=g;var v=new Box2D.Dynamics.b2ContactListener;v.BeginContact=function(a){var b=null,c=null,d=a.m_nodeA.other.GetUserData(),e=a.m_nodeB.other.GetUserData();if(d&&(d instanceof h.GamePiece?c=d:b=d),e&&(e instanceof h.GamePiece?c=e:b=e),b)if(b instanceof h.Peg){var f=new h.Util.ColorRGBA(246,218,106,255);b.highlight(!0,f),c.onHit(),h.SfxInterface.playFileAt(h.Util.NextRandom(0,3))}else h.SfxInterface.playFileAt(8);else if((void 0!==a.m_nodeA.other.pointValue||void 0!==a.m_nodeB.other.pointValue)&&!c.scored){c.body.SetAngularVelocity(0), c.body.SetLinearVelocity({x:0,y:0}),c.body.IsAwake(!1),c.scored=!0;var g=null;g=void 0!==a.m_nodeA.other.pointValue?a.m_nodeA.other:a.m_nodeB.other,h.onScoreEvent(g)}},this.world.SetContactListener(v),u.position.x=0,u.position.y=-.05,t.shape=new Box2D.Collision.Shapes.b2PolygonShape,t.shape.SetAsBox(j,.05),this.world.CreateBody(u).CreateFixture(t),u.position.x=-.7,u.position.y=k/2,t.shape=new Box2D.Collision.Shapes.b2PolygonShape,t.shape.SetAsBox(.05,k/2),this.world.CreateBody(u).CreateFixture(t),u.position.x=j+.7,t.shape=new Box2D.Collision.Shapes.b2PolygonShape,t.shape.SetAsBox(.05,k/2),this.world.CreateBody(u).CreateFixture(t);var w=-.9,x=new o;x.shape=new Box2D.Collision.Shapes.b2PolygonShape,x.density=.1,x.friction=.1,x.restitution=.98,u.position.x=-1.1,u.position.y=w+3.5;var y=[];y.push(new m(1,0)),y.push(new m(2,1)),y.push(new m(1,2)),y.push(new m(0,1)),x.shape.SetAsArray(y,0);var z=this.world.CreateBody(u),A=new this.Polygon(u.position.x,u.position.y,y);z.SetUserData(A),z.CreateFixture(x),b.addChild(A),u.position.x=-1.1,u.position.y=w+9.5,y=[],y.push(new m(1,0)),y.push(new m(2,1)),y.push(new m(1,2)),y.push(new m(0,1)),x.shape.SetAsArray(y,0),z=this.world.CreateBody(u),A=new this.Polygon(u.position.x,u.position.y,y),z.SetUserData(A),z.CreateFixture(x),b.addChild(A),u.position.x=j-.9,u.position.y=w+3.5,y=[],y.push(new m(1,0)),y.push(new m(2,1)),y.push(new m(1,2)),y.push(new m(0,1)),x.shape.SetAsArray(y,0),z=this.world.CreateBody(u),A=new this.Polygon(u.position.x,u.position.y,y),z.SetUserData(A),z.CreateFixture(x),b.addChild(A),u.position.x=j-.9,u.position.y=w+9.5,y=[],y.push(new m(1,0)),y.push(new m(2,1)),y.push(new m(1,2)),y.push(new m(0,1)),x.shape.SetAsArray(y,0),z=this.world.CreateBody(u),A=new this.Polygon(u.position.x,u.position.y,y),z.SetUserData(A),z.CreateFixture(x),b.addChild(A),this.pegs=[],this.pegArrays=[];var B,C=.15,D=2*C,E=0,F=1,G=.9,H=.1,I=[],J=4,K=2.25,L=w+3,M=j-2,N=M/J;I=[];for(var O=0;O0))return void console.log("GAME OVER");if(this.gamePieceLayer&&0===this.gamePieceLayer.children.length&&0===this.gamePieces.length){this.ballsLeft--,this.IndicatorGamePiece.hide(),this.resetPegs();var b=this.IndicatorGamePiece.x,c=this.IndicatorGamePiece.y,d=new Box2D.Dynamics.b2FixtureDef,e=new Box2D.Dynamics.b2BodyDef;d.friction=.9,d.density=1,d.restitution=.9,e.type=Box2D.Dynamics.b2Body.b2_dynamicBody,d.shape=new Box2D.Collision.Shapes.b2CircleShape(this.radiusDisk),e.position.x=b/this.scale,e.position.y=c/this.scale;var f=this.world.CreateBody(e),g=new this.GamePiece(f,2*this.radiusDisk,2*this.radiusDisk);g.body=f,f.SetUserData(g),f.CreateFixture(d),this.gamePieces.push(g),this.gamePieceLayer.addChild(g);var h=a.Util.NextRandom(5,15)*this.IndicatorGamePiece.dir;g.body.SetAngularVelocity(h)}else console.log("this.onGameStart() - game already in play. ABORTING")},resetPegs:function(){for(var a in this.pegs)this.pegs[a].reset()},resetGame:function(){this.totalScore=0,this.ballsLeft=this.gameChances,this.IndicatorGamePiece.show()},updateAllImages:function(){this.updateBackgroundImage(),this.updateProductImages()},updateProductImages:function(){this.productsLayer&&this.productsLayer.clear();for(var a=this.getImageAsset("productsImageSrc"),b=0;b=0;a--){var b=this.gamePieces[a];!b.body.IsAwake()&&b.scored&&(this.world.DestroyBody(b.body),this.gamePieces.splice(a,1),b.layer.removeChild(b))}for(var c in this.gamePieceLayer.children)this.gamePieceLayer.children[c].update();for(var d in this.productsLayer.children)this.productsLayer.children[d].update();for(var e in this.indicatorLayer.children)this.indicatorLayer.children[e].update();this.world.Step(1/60,1,1),this.drawDebugData&&this.world.DrawDebugData(),this.world.ClearForces(),document.StratiscapeDraw.draw(),document.stats&&document.stats.update()},initUtils:function(){var a=this;a.BGImage=Stratiscape.DrawnObject.extend({init:function(a,b,c){this.x=a,this.y=b,this.bgWidth=480,this.bgHeight=640,this.productWidth=420,this.productHeight=420,this.productPositionXoffset=60,this.src=c;var d=this;this.bgImageLoaded=!1,this.bgImage=new Image,this.bgImage.onload=function(){d.bgImageLoaded=!0},this.bgImage.src="/static/core/images/p3-2021/gameboard-bg.jpg",this.productImageLoaded=!1,this.productImage=new Image,this.productImage.onload=function(){d.productImageLoaded=!0},this.productImage.src=c},draw:function(a){if(this.bgImageLoaded&&this.productImageLoaded){a.drawImage(this.bgImage,this.x,this.y,this.bgWidth,this.bgHeight);var b=(this.bgWidth-this.productWidth)/2,c=(this.bgHeight-this.productHeight)/2-this.productPositionXoffset;a.drawImage(this.productImage,b,c,this.productWidth,this.productHeight)}else{var d=this;setTimeout(function(){d.draw(a)},20)}}}),a.WinnerText=Stratiscape.DrawnObject.extend({init:function(b,c,d){this.x=b,this.y=c,this.width=800,this.height=200,this.src=d;var e=Math.min(a.width/this.width,a.height/this.height);this.width*=e,this.height*=e,this.defaultWidth=this.width,this.defaultHeight=this.height,this.defaultPositionX=this.x-this.width/2,this.defaultPositionY=this.y-this.height/2;var f=this;this.imageLoaded=!1,this.image=new Image,this.image.onload=function(){f.imageLoaded=!0},this.image.src=this.src,this.hide()},draw:function(a){if(this.imageLoaded){var b=this.x-this.width/2,c=this.y-this.height;a.drawImage(this.image,b,c,this.width,this.height)}else{var d=this;setTimeout(function(){d.draw(a)},20)}},update:function(){},show:function(){this.x=this.defaultPositionX,this.y=this.defaultPositionY},hide:function(){this.y=-this.height},tween:function(){this.show(),this.x=a.width/2,this.y=a.height/2-this.height/2,this.width=0,this.height=0,TweenMax.to(this,1.2,{width:this.defaultWidth,height:this.defaultHeight,ease:Elastic.easeOut}),TweenMax.to(this,.4,{width:0,height:0,delay:1.2,y:a.height,ease:Cubic.easeIn,onComplete:this.tweenComplete,onCompleteParams:[this]})},tweenComplete:function(a){a.hide()}}),a.GamePiece=Stratiscape.DrawnObject.extend({init:function(b,c,d){this.body=b,this.width=c*a.scale,this.height=d*a.scale,this.wRadius=this.width/2,this.hRadius=this.height/2,this.imageLoaded=!1;var e=this;this.image=new Image,this.image.onload=function(){e.imageLoaded=!0},this.image.src="/static/core/images/p3-2021/ball.png"},update:function(){this.rotation=this.body.GetAngle(),this.x=this.body.GetWorldCenter().x*a.scale,this.y=this.body.GetWorldCenter().y*a.scale,this.layer.needsDisplay=!0},draw:function(a){if(a.save(),a.beginPath(),a.arc(this.x,this.y,this.wRadius,0*Math.PI,2*Math.PI),a.fillStyle="#f6c553",a.fill(),this.imageLoaded)a.translate(this.x,this.y),a.rotate(this.rotation),a.translate(-this.width/2,-this.height/2),a.drawImage(this.image,0,0);else{var b=this;setTimeout(function(){b.draw(a)},20)}a.restore()},onHit:function(){var b=new Box2D.Common.Math.b2Vec2(a.Util.NextRandom(10,20),a.Util.NextRandom(10,20)),c=a.Util.NextRandom(0,20)/a.scale;b=new Box2D.Common.Math.b2Vec2(c,0),this.body.ApplyImpulse(b,this.body.GetWorldCenter())}}),a.IndicatorGamePiece=Stratiscape.DrawnObject.extend({init:function(b,c,d){this.name="IndicatorGamePiece",this.body=b,this.posVec2=new Box2D.Common.Math.b2Vec2,this.dir=1,this.dirSpeed=.1,this.isHidden=!1,this.width=c*a.scale,this.height=d*a.scale,this.wRadius=this.width/2,this.hRadius=this.height/2,this.imageLoaded=!1;var e=this;this.image=new Image,this.image.onload=function(){e.imageLoaded=!0},this.image.src="/static/core/images/p3-2021/ball.png",this.x=this.body.GetWorldCenter().x*a.scale,this.y=this.body.GetWorldCenter().y*a.scale,this.show(),this.body.SetAwake(!1)},show:function(){var b=this.width/a.scale;this.posVec2.x=b/2,this.posVec2.y=.9,this.body.SetPosition(this.posVec2),this.dir=1,this.isHidden=!1},hide:function(){var b=this.width/a.scale;this.posVec2.x=b/2,this.posVec2.y=-.9,this.body.SetPosition(this.posVec2),this.isHidden=!0},update:function(){if(!this.isHidden){this.posVec2.x+=this.dirSpeed*this.dir,this.body.SetPosition(this.posVec2);var b=this.width/a.scale,c=a.width/a.scale;(this.body.GetPosition().x>=c-b/2||this.body.GetPosition().x<=b/2)&&(this.dir*=-1)}this.x=this.body.GetWorldCenter().x*a.scale,this.y=this.body.GetWorldCenter().y*a.scale,this.layer.needsDisplay=!0},draw:function(a){if(this.imageLoaded)a.save(),a.translate(this.x,this.y),a.rotate(this.rotation),a.translate(-this.width/2,-this.height/2),a.drawImage(this.image,0,0),a.restore();else{var b=this;setTimeout(function(){b.draw(a)},20)}}}),a.PrizeGamePiece=Stratiscape.DrawnObject.extend({init:function(b,c,d,e,f,g){this.x=b*a.scale,this.y=c*a.scale,this.width=e/a.scale,this.height=f/a.scale,this.productWidth=.9*this.width,this.productHeight=.9*this.width,this.productPositionXoffset=10,this.isTarget=g,this.hit=!1;var h=this,i=new a.Util.ColorRGBA(0,0,0,0);this.rect=new a.Rect(b,c,this.width,this.height,i,i),this.bgImageLoaded=!1,this.bgImage=new Image,this.bgImage.onload=function(){h.bgImageLoaded=!0},this.bgImage.src=!0===this.isTarget?"/static/core/images/p3-2021/prizepiece-target-bg.png":"/static/core/images/p3-2021/prizepiece-bg.png",this.productImageLoaded=!1,this.productImage=new Image,this.productImage.onload=function(){h.productImageLoaded=!0},this.productImage.src=d},draw:function(b){if(this.rect.draw(b),this.bgImageLoaded&&this.productImageLoaded)b.drawImage(this.bgImage,this.x,this.y,this.width*a.scale,this.height*a.scale),b.drawImage(this.productImage,this.x,this.y+this.productPositionXoffset,this.width*a.scale,this.width*a.scale);else{var c=this;setTimeout(function(){c.draw(b)},20)}},update:function(){this.layer.needsDisplay=!0},onHit:function(){var a=this;if(!this.hit){this.hit=!0;var b=this.y;TweenMax.to(a,.1,{y:b-25,yoyo:!0,repeat:3,onComplete:a.tweenComplete,onCompleteParams:[a]})}this.layer.needsDisplay=!0},tweenComplete:function(a){a.hit=!1}}),a.Peg=Stratiscape.DrawnObject.extend({init:function(b,c,d,e){this.x=b*a.scale,this.y=c*a.scale,this.width=d*a.scale,this.height=e*a.scale,this.initialWidth=this.width,this.initialHeight=this.height,this.highlighted=!1,this.type="Peg",this.hit=!1,this.color=a.defaultFillColor},update:function(){this.layer.needsDisplay=!0,this.x=this.body.GetWorldCenter().x*a.scale,this.y=this.body.GetWorldCenter().y*a.scale},onHit:function(){},tweenComplete:function(a){a.hit=!1},highlight:function(a,b){this.highlighted=a,this.color=b,this.layer.needsDisplay=!0},reset:function(){this.highlighted=!1,this.color=a.defaultFillColor,this.layer.needsDisplay=!0},draw:function(a){a.fillStyle=this.color.toString(),a.lineWidth=2,a.beginPath(),a.arc(this.x,this.y,this.width/2,0,2*Math.PI,!0),a.closePath(),a.fill(),a.stroke()}}),a.Rect=Stratiscape.DrawnObject.extend({init:function(b,c,d,e,f,g){this.x=b*a.scale,this.y=c*a.scale,this.width=d*a.scale,this.height=e*a.scale,this.fillColor=f,this.strokeColor=g},draw:function(a){a.fillStyle=this.fillColor.toString(),a.strokeStyle=this.strokeColor.toString(),a.fillRect(this.x,this.y,this.width,this.height),a.strokeRect(this.x,this.y,this.width,this.height)}}),a.Polygon=Stratiscape.DrawnObject.extend({init:function(b,c,d){this.points=[];for(var e=0;eb.r?this.r-1:this.r+1,this.g>b.g?this.g-1:this.g+1,this.b>b.b?this.b-1:this.b+1,this.a>b.a?this.a-1:this.a+1)},a.Util.ColorRGBA.prototype.equals=function(a){return this.r===a.r&&this.g===a.g&&this.b===a.b&&this.a===a.a},a.Util.ColorRGBA.prototype.toString=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.a+")"},a.Util.NextRandom=function(a,b){return null!==b&&void 0!==b||(b=a,a=0),a<0?b+=Math.abs(a):b-=a,Math.floor(Math.random()*b)+a},a.Util.parseShadow=function(a,b){a=a.split(", ");for(var c=[],d=0,e=a.length;d0?c.Images[0].Url:"",alt:c.Images&&c.Images.length>0&&c.Images[0].ImageAltText?c.Images[0].ImageAltText:c.Title},inventory:{stockCountLabel:f.InventoryCountLabel,checkStockCountLabel:f.CheckAvailabilityLabel,checkOtherStockCountlabel:f.CheckOtherStoresLabel,ourStockLabel:f.OurStockLabel},link:b,pwr:{id:"pwr-snippet-"+c.Id,apiKey:f.TrendingSocialApiKey,merchantId:f.TrendingSocialMerchantId,merchantGroupId:f.TrendingSocialMerchantGroupId,locale:f.TrendingSocialLocale},text1:c.OfferShortText,text2:c.Title,text3:"",title:c.Title}},this);return{badge:{heading:b.Title,headline:b.HeadlineText,text:"",cta:{url:"products?categories="+b.CategoryKey,label:f.ExploreLabel,isUrlAbsolute:!1}},slides:c,isBadgeOnLeft:!this.isDesktopLarge||a}}},this)},tileBadges:function(){return this.homeBadges.map(function(a){return{image:{alt:this.isDesktop||this.isDesktopLarge?a.DesktopImageAltText:a.MobileImageAltText,url:this.isDesktop||this.isDesktopLarge?a.DesktopImage:a.MobileImage},link:{label:a.Title,target:a.CTALinkTarget,url:a.CTALink}}},this)}},data:function(){return{banners:f.BannerSlides,bannerCarouselSlidesToShow:{desktop:1,tablet:1,mobile:1},categories:f.Categories,categoryCarouselsSlidesToShow:{desktop:3,tablet:2,mobile:2},homeBadges:f.HomeBadges,isCategoriesActive:!1,products:f.Products}},methods:{hideCategories:function(){this.isCategoriesActive=!1},initPowerReviews:function(){for(var a=[],b=0;this.badgeCarousels.length>b;b++)for(var c=0;this.badgeCarousels[b].slides.length>c;c++){var d={api_key:this.badgeCarousels[b].slides[c].pwr.apiKey,locale:this.badgeCarousels[b].slides[c].pwr.locale,merchant_group_id:this.badgeCarousels[b].slides[c].pwr.merchantGroupId,merchant_id:this.badgeCarousels[b].slides[c].pwr.merchantId,page_id:this.badgeCarousels[b].slides[c].id,components:{CategorySnippet:this.badgeCarousels[b].slides[c].pwr.id}};a.push(d)}pwr("render",a)}},mixins:[d.Responsive],mounted:function(){this.showInventory="False"===f.HideInventory;var a=this;setTimeout(function(){a.initPowerReviews()},2e3)},name:"RouteHome",template:"#module-p3-2021-route-home"}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Mixins"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Vue.Modules.P32021.VueComponents"),f=b.resolve("SDM.Data.P32021"),g=a.$,h=b.resolve("SDM.Util");e.RoutePlay={name:"RoutePlay",template:"#module-p3-2021-route-play",components:{carousel:d.ProductCarousel,navigation:e.Navigation,game:e.Game,"pop-up":d.PopUp},props:{},mixins:[c.PCOLogin],data:function(){return{STATE_PRODUCTS:"stateProducts",STATE_PRODUCT_DETAILS:"stateProductDetail",STATE_FAVOURITES:"stateFavourites",STATE_FAVOURITES_DETAILS:"stateFavouritesDetail",STATE_SUBMIT:"submit",STATE_SUBMIT_DETAILS:"submitDetail",STATE_COMPLETE:"stateProductComplete",activeStep:0,communicationOptIn:!1,currentProductDetail:{},currentState:"",ballotOverlayShow:!1,ballotOverlayAnimIn:!1,hammertime:"",isEmailErrorValdidationVisible:!1,isEmailErrorServerVisible:!1,isEmailSuccessVisible:!1,isEmailSuccessNoOptInVisible:!1,isEmailSuccessOptinSucessVisible:!1,isEmailSuccessOptinFailVisible:!1,isEmailOptinFailVisible:!1,isSubmissionLoadingEmail:!1,isSubmitBallotLoading:!1,products:f.Products,selectedProducts:[],selectedProductsIds:[],submissionEmail:"",totalSteps:0,weekCount:0,currentWeekNumber:0,emailSubmissionErrors:{email:!1},productLeftSelected:!1,productRightSelected:!1,instructionalOverlayShow:!1,currentLang:h.getShortLanguageCode()}},created:function(){var a=f.WeeklyPrizeSchedule.filter(function(a){return!0===a.CurrentWeek});this.currentWeekNumber=a[0].WeekNumber,this.currentState=this.STATE_PRODUCTS},mounted:function(){if(this.totalSteps=this.weeklyProductPairs.length,"/contest/play/1"!==this.$route.path&&"/contest/play/submit"!==this.$route.path&&this.$router.push({path:"/contest/play/1"}),this.activeStep=1,"/contest/play/submit"===this.$route.path&&h.getValueFromCookie("p32022products")){this.selectedProductsIds=JSON.parse(h.getValueFromCookie("p32022products"));for(var a=0;a0&&c.Images[0].ImageAltText?c.Images[0].ImageAltText:c.Title,src:c.Images&&c.Images.length>0?c.Images[0].Url:"",url:c.Images&&c.Images.length>0?c.Images[0].Url:""},link:{url:"/products/detail/"+c.Id,target:"_self",isAbsolute:!1},tag:"",title:c.Title,offer:c.OfferShortText}}},this)}}),data:function(){return{isAboutAccordionExpanded:!0,isLegalAccordionExpanded:!0,products:f.Products}},methods:Object.assign({},Vuex.mapActions("storeSelector",["setProductImageUrl","setProductHeading","setProductSubheading","setProductUpc"]),{checkAvailability:function(a){this.setProductImageUrl(a.Images&&a.Images.length>0?a.Images[0].Url:""),this.setProductHeading(a.Title),this.setProductUpc(a.Id),this.popUp.showPopUp()},goBack:function(){this.$router.go(-1)}}),mixins:[d.LockFocus],mounted:function(){setTimeout(function(){this.focusOnFirstElement()}.bind(this),500)},name:"RouteProductsDetail",template:"#module-p3-2021-route-products-detail",watch:{$route:function(){this.isAboutAccordionExpanded=!0,this.isLegalAccordionExpanded=!0}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Mixins"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Vue.Modules.P32021.VueComponents"),f=SDM.Data.P32021,g=b.resolve("SDM.Util"),h=a.$,i=a._;e.RouteProducts={components:{navigation:e.Navigation,"product-tile":d.ProductTile,"store-selector":d.StoreSelector},computed:{badgeTiles:function(){return this.productBadges.map(function(a){return{type:"badge",badgeTile:{image:{alt:this.isDesktop||this.isDesktopLarge?a.DesktopImageAltText:a.MobileImageAltText,url:this.isDesktop||this.isDesktopLarge?a.DesktopImage:a.MobileImage},link:{label:a.Title,target:a.CTALinkTarget,url:a.CTALink}}}},this)},filterdProducts:function(){return i.shuffle(this.productsByGroup.filter(function(a){var b=0===this.selectedBrands.length||this.selectedBrands.includes(a.BrandSlug),c=0===this.selectedCategories.length||a.Categories.reduce(function(a,b){return a||this.selectedCategories.includes(b.TitleSlug)}.bind(this),!1);return b&&c}.bind(this)))},filterdProductsByBrands:function(){return this.productsByGroup.filter(function(a){return 0===this.selectedBrands.length||this.selectedBrands.includes(a.BrandSlug)}.bind(this))},filterdProductsByCategories:function(){return this.productsByGroup.filter(function(a){return 0===this.selectedCategories.length||a.Categories.reduce(function(a,b){return a||this.selectedCategories.includes(b.TitleSlug)}.bind(this),!1)}.bind(this))},paginatedProducts:function(){var a=[];a.push(this.productTiles.slice(0,this.productPerPage-this.productBadgeSize*Math.min(this.badgeTiles.length,2)));for(var b=this.productTiles.slice(this.productPerPage-this.productBadgeSize*Math.min(this.badgeTiles.length,2),this.productTiles.length),c=0;c0&&a.Images[0].ImageAltText?a.Images[0].ImageAltText:a.Title,src:a.Images&&a.Images.length>0?a.Images[0].Url:"",url:a.Images&&a.Images.length>0?a.Images[0].Url:""},link:{url:"/products/detail/"+a.Id,target:"_self",isAbsolute:!1},pwr:{id:"pwr-snippet-"+a.Id},tag:"",title:a.Title,offer:a.OfferShortText}}}},this)},productsByGroup:function(){return Object.keys(this.products).reduce(function(a,b){return this.products[b]&&this.products[b].ProductGroup===this.productGroup&&a.push(this.products[b]),a}.bind(this),[])},inventory:function(){return{stockCountLabel:f.InventoryCountLabel,checkStockCountLabel:f.CheckAvailabilityLabel,checkOtherStockCountlabel:f.CheckOtherStoresLabel}},isClearButtonEnabled:function(){return this.selectedBrands.length>0||this.selectedCategories.length>0},totalPageNumber:function(){var a=2,b=this.productTiles.length,c=a+b;return Math.ceil(c/this.productPerPage)}},data:function(){return{brands:f.BrandFilters,categories:f.CategoryFilters,componentKey:0,currentPageNumber:1,isFiltersActive:!1,filteredProductsBrands:[],filteredProductsCategories:[],products:f.Products,productBadges:f.ProductBadges,productBadgeSize:2,productPerPage:12,productGrid:[],selectedCategories:[],selectedBrands:[]}},methods:{clearFilter:function(){this.isClearButtonEnabled&&(this.selectedBrands=[],this.selectedCategories=[],this.filteredProductsCategories=this.getCategoriesFromProducts(this.productsByGroup),this.filteredProductsBrands=this.getBrandsFromProducts(this.productsByGroup),this.currentPageNumber=1,this.updateUrlParam(),this.initProductGrid())},getBrandsFromProducts:function(a){return a.reduce(function(a,b){return-1===a.findIndex(function(a){return a===b.BrandSlug})&&a.push(b.BrandSlug),a},[]).map(function(a){return this.brands.find(function(b){if(b.TitleSlug===a)return b})}.bind(this)).sort(function(a,b){return a.Titleb.Title?1:0})},getCategoriesFromProducts:function(a){return a.reduce(function(a,b){return b.Categories.forEach(function(b){-1===a.findIndex(function(a){return a===b.TitleSlug})&&a.push(b.TitleSlug)}),a},[]).map(function(a){return this.categories.find(function(b){if(b.TitleSlug===a)return b})}.bind(this)).sort(function(a,b){return a.Titleb.Title?1:0})},hideFilters:function(){this.isFiltersActive=!1},initialize:function(){this.selectedCategories=[],this.selectedBrands=[]},initPowerReviews:function(){for(var a=[],b=this.paginatedProducts[this.currentPageNumber-1],c=0;b.length>c;c++)a[c]={api_key:f.TrendingSocialApiKey,locale:f.TrendingSocialLocale,merchant_group_id:f.TrendingSocialMerchantGroupId,merchant_id:f.TrendingSocialMerchantId,page_id:b[c].productTile.product.id,components:{CategorySnippet:b[c].productTile.product.pwr.id}};pwr("render",a)},initProductGrid:function(){var a=this.currentPageNumber*this.productPerPage-this.productBadgeSize*Math.min(this.badgeTiles.length,2),b=this.productTiles.slice(0,a);this.badgeTiles.length>0&&b.splice(2,0,this.badgeTiles[0]),this.badgeTiles.length>1&&b.splice(7,0,this.badgeTiles[1]);var c=this;this.productGrid=b,setTimeout(function(){c.initPowerReviews()},100)},loadMoreProducts:function(){g.scrollTo$ElementAsync(h(this.$refs.loadMoreButton),500),this.currentPageNumber=this.currentPageNumber+1,this.initProductGrid()},onBrandsFilterChange:function(){this.currentPageNumber=1,this.filteredProductsCategories=this.getCategoriesFromProducts(this.filterdProductsByBrands);var a=this.selectedCategories.filter(function(a){return this.filteredProductsCategories.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedCategories.length!==a.length&&(this.selectedCategories=a),this.updateUrlParam(),this.initProductGrid()},onCategoriesFilterChange:function(){this.currentPageNumber=1,this.filteredProductsBrands=this.getBrandsFromProducts(this.filterdProductsByCategories);var a=this.selectedBrands.filter(function(a){return this.filteredProductsBrands.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedBrands.length!==a.length&&(this.selectedBrands=a),this.updateUrlParam(),this.initProductGrid()},updateUrlParam:function(){var a={};this.selectedBrands.length>0&&(a=Object.assign({},a,{brands:this.selectedBrands.join(",")})),this.selectedCategories.length>0&&(a=Object.assign({},a,{categories:this.selectedCategories.join(",")})),g.setUrlVars(a)}},mixins:[c.Responsive],mounted:function(){this.routeBrands&&this.routeBrands.split(",").forEach(function(a){this.selectedBrands.push(a)},this),this.routeCategories&&this.routeCategories.split(",").forEach(function(a){this.selectedCategories.push(a)},this),this.filteredProductsCategories=this.getCategoriesFromProducts(this.productsByGroup),this.filteredProductsBrands=this.getBrandsFromProducts(this.filterdProductsByCategories),this.initProductGrid()},name:"RouteProducts",props:{routeBrands:{type:String,default:""},routeCategories:{type:String,default:""}},template:"#module-p3-2021-route-products",watch:{filterdProducts:function(){this.currentPageNumber=1},productsByGroup:function(){this.filteredProductsBrands=this.getBrandsFromProducts(this.productsByGroup),this.filteredProductsCategories=this.getCategoriesFromProducts(this.productsByGroup)},productGroup:function(){this.initialize()}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.P32021.VueComponents"),d=SDM.Data.P32021;c.RouteTrending={components:{navigation:c.Navigation},data:function(){return{isModalActive:!1,videoData:[],focusableElements:'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]'}},methods:{initSocial:function(){POWERREVIEWS.display.render({api_key:d.TrendingSocialApiKey,locale:d.TrendingSocialLocale,merchant_id:d.TrendingSocialMerchantId,CD4_IRL_IMAGE_GALLERY_STYLE:"GRID",components:{IRLSnippet:"module-top-picks-2020-trending__social"}})},initVideo:function(a){if(a){var b=this.findObjectByKey(this.videoData,"FriendlyUrlTitle",a);this.onVideoThumbnailClick(b.YouTubeVideoID,b.Title)}else this.onCloseVideo()},onVideoThumbnailClick:function(a,b){this.isModalActive=!0,document.body.style.overflow="hidden",document.querySelector("#module-p3-2021-route-trending-video-embed__video").innerHTML='',TweenMax.to(".module-p3-2021-route-trending-video-embed",.4,{opacity:1}),setTimeout(function(){$(".module-p3-2021-route-trending-video-embed__close").focus()},500)},onCloseVideo:function(){if(this.isModalActive){var a=this;TweenMax.to(".module-p3-2021-route-trending-video-embed",.3,{opacity:0,onComplete:a.closeVideo})}},closeVideo:function(){this.isModalActive=!1,document.body.style.overflow="auto",document.querySelector("#module-p3-2021-route-trending-video-embed__video").innerHTML=""},findObjectByKey:function(a,b,c){for(var d=0;d0))return null;var c=b.Games[0];return{cta:{isAbsolute:!1,label:e.PlayButtonLabel,url:"/play?week="+(a+1)+"&game=1"},heading:e.GameLabel+" 1",productImages:c.Products.map(function(a){var b=this.products[a];return b?{url:b.Images&&b.Images.length>0&&b.Images[0].Url?b.Images[0].Url:"",alt:b.Images&&b.Images.length>0&&b.Images[0].ImageAltText?b.Images[0].ImageAltText:b.Title}:null},this)}}},data:function(){return{products:e.Products,weeks:e.WeeklyPrizeSchedule}},methods:{goBack:function(){this.$router.go(-1)}},mixins:[c.Responsive],mounted:function(){},name:"RouteTutorial",template:"#module-p3-2021-route-tutorial"}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Modules.P32021.VueComponents"),f=b.resolve("SDM.Data.P32021");c.P32021=function(){var a=[{component:e.RouteHome,name:"home",path:"/"},{component:e.RouteContest,name:"contest",path:"/contest"},{component:e.RouteTutorial,name:"how-to-play",path:"/contest/how-to-play"},{component:e.RoutePlay,name:"play",path:"/contest/play",redirect:"/contest/play/1"},{component:e.RoutePlay,name:"play",path:"/contest/play/:step"},{component:e.RoutePlay,name:"play",path:"/contest/play/:step/:product"},{component:e.RouteProducts,name:"products",path:"/products",props:function(a){return{routeBrands:a.query.brands,routeCategories:a.query.categories}}},{component:e.RouteProductsDetail,name:"detail",path:"/products/detail/:productId"}];"True"!==f.HideTrending?(a.push({component:e.RouteTrending,name:"trending",path:"/trending"}),a.push({component:e.RouteTrending,name:"trending",path:"/trending/:videoId"})):(a.push({component:e.RouteTrending,name:"trending",path:"/trending",redirect:"/"}),a.push({component:e.RouteTrending,name:"trending",path:"/trending/:videoId",redirect:"/"}));var b=new VueRouter({base:f.CampaignRoute,mode:"history",routes:a,scrollBehavior:function(){if(this&&this.app&&this.app.$el){var a='a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]',b=this.app.$el.querySelectorAll(a)[0];b&&b.focus()}return{x:0,y:0,behavior:"smooth"}}}),c=new Vuex.Store({modules:{storeSelector:d.StoreSelector,p32021:{actions:{setGameScore:function(a,b){a.commit("setGameScore",b)},setIsGameCompleted:function(a,b){a.commit("setIsGameCompleted",b)}},mutations:{setGameScore:function(a,b){a.gameScore=b},setIsGameCompleted:function(a,b){a.isGameCompleted=b}},namespaced:!0,state:function(){return{gameScore:0,isGameCompleted:!1}}}}});new Vue({components:{"footer-menu":e.FooterMenu},el:"#module-p3-2021",methods:Object.assign({},Vuex.mapActions("storeSelector",{setInventories:"setInventories"}),{}),mounted:function(){this.setInventories(f.Inventories.Stores)},router:b,store:c})}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.Spring2021.VueComponents").Footer={computed:{},data:function(){return{}},methods:{},mounted:function(){},props:{},template:"#module-spring-2021-footer",updated:function(){},watch:{}}}(this,this.jQuery),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Subscription"),e=b.resolve("SDM.Util"),f=b.resolve("SDM.Data.PromoSignUp");c.PromoSignUp=function(){new Vue({el:"#module-promo-sign-up",data:function(){return{submissionEmail:"",submissionTelephone:"",isSubmissionLoadingEmail:!1,isSubmissionLoadingTelephone:!1,email:"",errors:{email:!1},isSending:!1,isSent:!1,isPhoneErrorValdidationVisible:!1,isPhoneErrorServerVisible:!1,isPhoneSuccessVisible:!1,isSubmissionLoadingPhone:!1,isEmailErrorValdidationVisible:!1,isEmailErrorServerVisible:!1,isEmailSuccessVisible:!1,isDropDownVisible:!1}},created:function(){},mounted:function(){},components:{},methods:{checkSubmissionTelephone:function(){return!!this.isSubmissionTelephoneValid},submitEmail:function(){this.isEmailErrorValdidationVisible=!1,this.isEmailErrorServerVisible=!1;var a=this.$refs.signupForm.dataset.wgEsCasl||"";this.$refs.email&&(this.errors.email=!(this.submissionEmail.length&&/\S+@\S+/.test(this.submissionEmail))),_.some(this.errors,function(a){return a})?(this.isEmailErrorValdidationVisible=!0,this.reportValidation(this.$refs.email,f.EmailErrorValidation)):(this.isSubmissionLoadingEmail=!0,this.isEmailErrorValdidationVisible=!1,this.isEmailErrorServerVisible=!1,this.isSending=!0,d.signup(this.submissionEmail,a).done(_.bind(function(){console.log("1"),this.isSent=!0,this.isEmailSuccessVisible=!0,e.saveCookie("salesforceSubscription","true")},this)).fail(_.bind(function(a){console.log("2"),this.isEmailErrorServerVisible=!0,console.log(a)},this)).always(_.bind(function(){console.log("3"),this.isSending=!1,this.isSubmissionLoadingEmail=!1},this)))},submitPhone:function(a,b,c){if(this.checkSubmissionTelephone()){var d=this.submissionTelephone.replace(/[()-.]/g,"");this.isSubmissionLoadingPhone=!0,this.isPhoneErrorValdidationVisible=!1,this.isPhoneErrorServerVisible=!1;var e=JSON.stringify({PhoneNumber:d,ShortCode:c,TriggerID:b});$.ajax({method:"POST",contentType:"application/json",url:"/global/submitphoneto3c",data:e,dataType:"json",headers:{__RequestVerificationToken:a}}).done(function(a){"OK"===a.status?(this.isPhoneSuccessVisible=!0,this.isPhoneErrorValdidationVisible=!1):(this.isPhoneErrorServerVisible=!0,console.log("ERROR: "),console.log(a.message))}.bind(this)).fail(function(a){this.isPhoneErrorServerVisible=!0,console.log("ERROR: "),console.log(a)}.bind(this)).always(function(){this.isSubmissionLoadingPhone=!1}.bind(this))}else this.isPhoneErrorServerVisible=!1,this.isPhoneErrorValdidationVisible=!0,this.reportValidation(this.$refs.tel,f.PhoneErrorValidation)},reportValidation:function(a,b){a.validity&&a.setCustomValidity(b),a.reportValidity()},toggleDropdown:function(){this.isDropDownVisible=!this.isDropDownVisible}},computed:{isSubmissionTelephoneValid:function(){return""!==this.submissionTelephone&&null!==this.submissionTelephone.match(/^[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}$/im)}},watch:{email:function(){this.submissionEmail.length&&(this.errors.email=!1)}}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Data.Spring2021"),d=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents"),e=b.resolve("SDM.Vue.Widgets"),f=b.resolve("SDM.Vue.Mixins");d.Hero={template:"#spring-2021-hero-template",components:{carousel:e.ProductCarousel},mixins:[f.Responsive],props:{baseBackgroundColor:String,featuredBadges:Object,themesModel:Array,ttwBackgroundColor:String},data:function(){return{banner:{},banners:c.BannerSlides,bannerCarouselSlidesToShow:{desktop:1,tablet:1,mobile:1},currentCategory:"",currentSection:"",headerHexColor:"",heroImage:"",heroImageMobile:"",toPath:"",fromPath:"",themeModel:{},isTextToWin:!1,selectedTheme:{}}},created:function(){this.updateCurrentSection()},mounted:function(){this.updateHeroBanner()},methods:{updateCurrentSection:function(){this.$route.path.split("/").filter(String)[0]?this.currentSection=this.$route.path.split("/").filter(String)[0].toLowerCase():this.currentSection="/"},updateHeroBanner:function(){if("products"===this.currentSection)if(this.$route.params.productId)this.banner={};else if(1===this.$store.state.theme.length){var a=this;this.banner=c.ThemesJson.filter(function(b){return b.ThemeKey===a.$store.state.theme[0]})[0]}else this.banner={BannerDesktop:c.HeroProductsImageDesktop,BannerMobile:c.HeroProductsImageMobile,BannerDesktopAltText:c.HeroProductsAltText,FeaturedHeroBackgroundHex:c.HeroProductsBackgroundHexColor};else"contest"===this.currentSection?this.banner={BannerDesktop:c.HeroTTWImageDesktop,BannerMobile:c.HeroTTWImageMobile,BannerDesktopAltText:c.HeroTTWAltText,FeaturedHeroBackgroundHex:c.HeroTTWBackgroundHexColor}:"meditations-and-more"===this.currentSection&&(this.banner={BannerDesktop:c.HeroMeditationsImageDesktop,BannerMobile:c.HeroMeditationsImageMobile,BannerDesktopAltText:c.HeroMeditationsAltText,CarouselBackgroundHex:c.HeroMeditationsBackgroundHexColor})}},computed:{bannerCarousel:function(){return this.banners.map(function(a){var b=document.createElement("div");b.innerHTML=a.UrlLink?a.UrlLink.trim():"";var c=b.firstChild;return{backgroundColor:a.BackgroundHexColor,image:{url:this.isDesktop||this.isDesktopLarge?a.ImageDesktop.URL:a.ImageMobile.URL,alt:this.isDesktop||this.isDesktopLarge?a.ImageDesktop.Label:a.ImageMobile.Label},link:{isAbsolute:!0,target:c?c.target:"",url:c?c.href:""}}},this)},bannerCarouselProps:function(){return{slides:this.bannerCarousel,slidesToShow:this.bannerCarouselSlidesToShow,isArrowsVisible:{desktop:!0,tablet:!1,mobile:!1},isAutoplay:{desktop:!0,tablet:!0,mobile:!0},isControlsInset:{desktop:!0,tablet:!0,mobile:!0},isPaginationVisible:{desktop:!0,tablet:!0,mobile:!0}}}},watch:{$route:function(a,b){this.toPath=a.path,this.fromPath=b.path,this.updateCurrentSection(),this.updateHeroBanner()},"$store.state.theme":function(){this.updateHeroBanner()}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Data.Spring2021");c.Navigation={template:"#module-spring-2021-navigation",components:{navigation:d.Navigation},data:function(){return{menuLabel:e.MobileMenuLabel,menuOpenLabel:e.MobileMenuOpenLabel,menuCloseLabel:e.MobileMenuCloseLabel,links:[]}},mounted:function(){this.links.push({isAbsolute:!1,label:e.HomeTabLabel,target:"",url:"/"}),this.links.push({isAbsolute:!1,label:e.ProductsTabLabel,target:"",url:"/products"}),this.links.push({isAbsolute:!1,label:e.TrendingTabLabel,target:"",url:"/meditations-and-more"}),this.links.push({isAbsolute:!1,label:e.TextToWinTabLabel,target:"",url:"/contest"})},methods:{},computed:{}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents"),d=b.resolve("SDM.Vue.Mixins"),e=b.resolve("SDM.Vue.Widgets"),f=SDM.Data.Spring2021,g=b.resolve("SDM.Util"),h=a.$;c.ProductsGrid={template:"#module-spring-2021-products-grid",components:{"product-tile":e.ProductTile,"store-selector":e.StoreSelector},mixins:[d.Responsive],props:{routeFilters:{type:String,default:""},routeCategories:{type:String,default:""},themeHeading:{type:String,default:""},themeKey:{type:String,default:""}},data:function(){return{categories:f.Categories,currentPageNumber:0,isFiltersActive:!1,isFiltersMobile:!1,filteredProductsThemes:[],filteredProductsCategories:[],productsJsonData:{},productBadges:f.ProductBadges,productBadgeSize:2,productGrid:[],productPerPage:12,screenWidth:0,selectedThemes:[],selectedCategories:[],subThemeFilters:[],themeBadgesData:[],themesJsonData:f.Themes}},mounted:function(){this.productsJsonData=f.Products,this.selectedThemes=this.$route.query.themes?this.$route.query.themes.split(","):[],this.selectedCategories=this.$route.query.categories?this.$route.query.categories.split(","):[],this.$store.state.theme=this.selectedThemes,this.filteredProductsThemes=this.getThemesFromProducts(this.productsByGroup),this.filteredProductsCategories=this.getCategoriesFromProducts(this.productsByGroup),this.initProductGrid(),window.addEventListener("resize",_.debounce(this.onResize,50)),this.onResize()},methods:{clearFilter:function(){this.isClearButtonEnabled&&(this.selectedThemes=[],this.selectedCategories=[],this.filteredProductsCategories=this.getCategoriesFromProducts(this.productsByGroup),this.filteredProductsThemes=this.getThemesFromProducts(this.productsByGroup),this.currentPageNumber=0,this.productGrid=[],this.updateUrlParam(),this.initProductGrid())},onResize:function(){this.screenWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),this.screenWidth>640?(TweenLite.set(".module-spring-2021-products__filters-container",{height:"auto"}),this.isFiltersActive=!1,this.isFiltersMobile=!1):this.isFiltersMobile||(TweenLite.set(".module-spring-2021-products__filters-container",{height:0}),this.isFiltersActive=!1,this.isFiltersMobile=!0)},getThemesFromProducts:function(a){return a.reduce(function(a,b){return b.Themes.forEach(function(b){-1===a.findIndex(function(a){return a===b.TitleSlug})&&a.push(b.TitleSlug)}),a},[]).map(function(a){return this.themesJsonData.find(function(b){if(b.TitleSlug===a)return b})}.bind(this)).sort(function(a,b){return a.Titleb.Title?1:0})},getCategoriesFromProducts:function(a){return a.reduce(function(a,b){return b.Categories.forEach(function(b){-1===a.findIndex(function(a){return a===b.TitleSlug})&&a.push(b.TitleSlug)}),a},[]).map(function(a){return this.categories.find(function(b){if(b.TitleSlug===a)return b})}.bind(this)).sort(function(a,b){return a.Titleb.Title?1:0})},hideFilters:function(){this.isFiltersActive=!1},initPowerReviews:function(){for(var a=[],b=this.paginatedProducts[this.currentPageNumber],c=0;b.length>c;c++)"product"===b[c].type&&(a[c]={api_key:f.PowerReviewsApiKey,locale:f.PowerReviewsLocale,merchant_group_id:f.PowerReviewsMerchantGroupId,merchant_id:f.PowerReviewsMerchantId,page_id:b[c].productTile.product.id,components:{CategorySnippet:b[c].productTile.product.pwr.id}});pwr("render",a)},initProductGrid:function(){this.productGrid=this.productGrid.concat(this.paginatedProducts[this.currentPageNumber]);var a=this;Vue.nextTick(function(){a.initPowerReviews()})},loadMoreProducts:function(){g.scrollTo$ElementAsync(h(this.$refs.loadMoreButton),500),this.currentPageNumber++,this.initProductGrid()},onThemesFilterChange:function(){this.filteredProductsCategories=this.getCategoriesFromProducts(this.filterdProductsByThemes);var a=this.selectedCategories.filter(function(a){return this.filteredProductsCategories.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedCategories.length!==a.length&&(this.selectedCategories=a),this.currentPageNumber=0,this.productGrid=[],this.updateUrlParam(),this.initProductGrid()},onCategoriesFilterChange:function(){this.filteredProductsThemes=this.getThemesFromProducts(this.filterdProductsByCategories);var a=this.selectedThemes.filter(function(a){return this.filteredProductsThemes.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedThemes.length!==a.length&&(this.selectedThemes=a),this.currentPageNumber=0,this.productGrid=[],this.updateUrlParam(),this.initProductGrid()},updateUrlParam:function(){var a={};this.selectedThemes.length>0?(a=Object.assign({},a,{themes:this.selectedThemes.join(",")}),this.$store.state.theme=this.selectedThemes):this.$store.state.theme=[],this.selectedCategories.length>0&&(a=Object.assign({},a,{categories:this.selectedCategories.join(",")})),g.setUrlVars(a)}},computed:{badgeTiles:function(){return this.productBadges.map(function(a){return{type:"badge",badgeTile:{image:{alt:a.DesktopImageAltText,desktopUrl:a.DesktopImage,mobileUrl:a.MobileImage},link:{label:a.Title,target:a.CTALinkTarget,url:a.CTALink}}}},this)},filterdProducts:function(){return _.shuffle(this.productsByGroup.filter(function(a){var b=0===this.selectedThemes.length||a.Themes.reduce(function(a,b){return a||this.selectedThemes.includes(b.TitleSlug)}.bind(this),!1),c=0===this.selectedCategories.length||a.Categories.reduce(function(a,b){return a||this.selectedCategories.includes(b.TitleSlug)}.bind(this),!1);return b&&c}.bind(this)))},filterdProductsByThemes:function(){return this.productsByGroup.filter(function(a){return 0===this.selectedThemes.length||a.Themes.reduce(function(a,b){return a||this.selectedThemes.includes(b.TitleSlug)}.bind(this),!1)}.bind(this))},filterdProductsByCategories:function(){return this.productsByGroup.filter(function(a){return 0===this.selectedCategories.length||a.Categories.reduce(function(a,b){return a||this.selectedCategories.includes(b.TitleSlug)}.bind(this),!1)}.bind(this))},isClearButtonEnabled:function(){return this.selectedThemes.length>0||this.selectedCategories.length>0},paginatedProducts:function(){var a=[],b=this.productTiles.slice(0,this.productPerPage-this.productBadgeSize*Math.min(this.badgeTiles.length,2));b.length>=2&&this.badgeTiles.length>0&&b.splice(2,0,this.badgeTiles[0]),b.length>=7&&this.badgeTiles.length>1&&b.splice(7,0,this.badgeTiles[1]),a.push(b);for(var c=this.productTiles.slice(this.productPerPage-this.productBadgeSize*Math.min(this.badgeTiles.length,2),this.productTiles.length),d=0;d0?a.Images[0].Url:""},link:b,pwr:{id:"pwr-snippet-"+a.Id},tags:a.Tags,title:a.Title,offer:a.OfferShortText}}}},this)},productsByGroup:function(){return Object.keys(this.productsJsonData).reduce(function(a,b){return this.productsJsonData[b]&&this.productsJsonData[b].ProductGroup===this.productGroup&&a.push(this.productsJsonData[b]),a}.bind(this),[])},inventory:function(){return{stockCountLabel:f.InventoryCountLabel,checkStockCountLabel:f.CheckAvailabilityLabel,checkOtherStockCountlabel:f.CheckOtherStoresLabel}},totalPageNumber:function(){var a=4,b=this.productTiles.length,c=a+b;return Math.ceil(c/this.productPerPage)-1}},watch:{filterdProducts:function(){this.currentPageNumber=0},productsByGroup:function(){}}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.Spring2021.VueComponents").BadgeCta={computed:{},data:function(){return{}},methods:{},mounted:function(){},props:{badge:{type:Object,default:null}},template:"#module-spring-2021-badge-cta",updated:function(){},watch:{}}}(this,this.jQuery),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents"),d=b.resolve("SDM.Vue.Mixins");c.Video={template:"#module-spring-2021-video",components:{},props:{videoData:[]},data:function(){return{isModalActive:!1}},mixins:[d.LockFocus],mounted:function(){this.$route.query.v&&this.initVideo(this.$route.query.v)},methods:{initVideo:function(a){this.onVideoThumbnailClick(a)},onVideoThumbnailClick:function(a){this.isModalActive=!0,document.body.style.overflow="hidden",document.querySelector("#module-spring-2021-video-embed__video").innerHTML='',TweenMax.to(".module-spring-2021-video-embed",.4,{opacity:1}),setTimeout(function(){$(".module-spring-2021-video-embed__close").focus()},500)},onCloseVideo:function(){if(this.isModalActive){var a=this;TweenMax.to(".module-spring-2021-video-embed",.3,{opacity:0,onComplete:a.closeVideo})}},closeVideo:function(){this.isModalActive=!1,document.body.style.overflow="auto",document.querySelector("#module-spring-2021-video-embed__video").innerHTML=""},findObjectByKey:function(a,b,c){for(var d=0;db;b++)for(var c=0;this.badgeCarousels[b].slides.length>c;c++){var d={api_key:g.PowerReviewsApiKey,locale:g.PowerReviewsLocale,merchant_group_id:g.PowerReviewsMerchantGroupId,merchant_id:g.PowerReviewsMerchantId,page_id:this.badgeCarousels[b].slides[c].id,components:{CategorySnippet:this.badgeCarousels[b].slides[c].pwr.id}};a.push(d)}pwr("render",a)},hideCategories:function(){this.isSeeAllListsActive=!1}},components:{badgeCta:c.BadgeCta,carousel:f.ProductCarousel,"store-selector":f.StoreSelector,"video-modal":c.Video},computed:{badgeCarousels:function(){var a=!0;return this.categories.map(function(b){a=!a;var c=b.FeaturedProducts.map(function(a){var c={};return c=""!==a.BuyNowLink?{url:a.BuyNowLink,urlTarget:"_blank",target:"_blank",isUrlAbsolute:!0,isAbsolute:!0}:{url:"/products/"+a.Id+"?themes="+b.ThemeKey,urlTarget:"_self",isUrlAbsolute:!1},{id:a.Id,image:{url:a.Images&&a.Images.length>0?a.Images[0].Url:"",alt:a.Title},inventory:{stockCountLabel:g.InventoryCountLabel,checkStockCountLabel:g.CheckAvailabilityLabel,checkOtherStockCountlabel:g.CheckOtherStoresLabel,ourStockLabel:g.OurStockLabel},link:c,pwr:{id:"pwr-snippet-"+a.Id},text1:a.OfferShortText,text2:a.Title,text3:"",tags:a.Tags}},this);return{badge:{heading:b.CarouselText,hexColorBg:b.CarouselBackgroundHex,hexColorFont:b.CarouselFontHex,hexColorCta:b.FeaturedCarouselButtonBgHex,hexColorCtaLabel:b.CarouselButtonFontHex,text:"",cta:{url:"/products?themes="+b.ThemeKey,label:g.ExploreLabel,isUrlAbsolute:!1}},slides:c,isBadgeOnLeft:!this.isDesktopLarge||a}},this)},bottomBadges:function(){return this.bottomBadgesData.map(function(a){return{image:{alt:this.isDesktop||this.isDesktopLarge?a.DesktopImageAltText:a.MobileImageAltText,url:this.isDesktop||this.isDesktopLarge?a.DesktopImage:a.MobileImage},link:{isAbsolute:!1,target:a.CTALinkTarget,url:a.CTALink},youTubeVideoId:a.YouTubeVideoID,youTubeVideoCta:a.TitleSlug}},this)},tileBadges:function(){return this.homeBadges.map(function(a){return{image:{alt:this.isDesktop||this.isDesktopLarge?a.DesktopImageAltText:a.MobileImageAltText,url:this.isDesktop||this.isDesktopLarge?a.DesktopImage:a.MobileImage},link:{label:a.Title,target:a.CTALinkTarget,url:a.CTALink}}},this)}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents");b.resolve("SDM.Vue.Modules.Spring2021.VueRoutes").Products={template:"#module-spring-2021-products",name:"RouteProducts",components:{"products-grid":c.ProductsGrid},data:function(){return{}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Widgets"),d=b.resolve("SDM.Vue.Modules.Spring2021.VueRoutes"),e=b.resolve("SDM.Data.Spring2021");d.ProductsDetail={data:function(){return{componentKey:0,currentImageIndex:0,isAboutAccordionExpanded:!0,isLegalAccordionExpanded:!1,product:{},relatedProducts:[],toRoute:"",fromRoute:""}},name:"RouteProductDetail",template:"#module-spring-2021-route-products-detail",components:{productTile:c.ProductTile,"store-selector-modal":c.StoreSelectorModal},mounted:function(){this.initProducts()},beforeRouteEnter:function(a,b,c){c(c(function(c){c.toRoute=a,c.fromRoute=b}))},methods:Object.assign({},Vuex.mapActions("storeSelector",["setProductImageUrl","setProductHeading","setProductSubheading","setProductUpc"]),{initProducts:function(){var a=this;this.product=e.Products.filter(function(b){return b.Id===a.$route.params.productId}),this.product=this.product[0],this.relatedProducts=[],this.product.RelatedProductIDs.length>0&&this.product.RelatedProductIDs.forEach(function(b){a.relatedProducts.push(e.Products.filter(function(a){return a.Id===b})[0])}),Vue.nextTick(function(){a.initPowerReviews(),TweenLite.to(".module-spring-2021-route-products-detail",.4,{opacity:1,delay:.2})})},checkAvailability:function(a){this.setProductImageUrl(a.Images&&a.Images.length>0?a.Images[0].Url:""),this.setProductHeading(a.Title),this.setProductUpc(a.Id),this.popUp.showPopUp()},goBack:function(){this.fromRoute.name?this.$router.go(-1):this.$router.push("/products")},initPowerReviews:function(){for(var a=[],b=0;this.relatedProductTiles.length>b;b++)a[b]={api_key:e.PowerReviewsApiKey,locale:e.PowerReviewsLocale,merchant_group_id:e.PowerReviewsMerchantGroupId,merchant_id:e.PowerReviewsMerchantId,page_id:this.relatedProductTiles[b].product.id,components:{CategorySnippet:this.relatedProductTiles[b].product.pwr.id}};pwr("render",a)},toggleAboutAccordian:function(){this.isAboutAccordionExpanded?(TweenLite.to(".module-spring-2021-route-products-detail__accordion-text-wrapper--about",.4,{height:0}),this.isAboutAccordionExpanded=!1):(TweenLite.set(".module-spring-2021-route-products-detail__accordion-text-wrapper--about",{height:"auto"}),TweenLite.from(".module-spring-2021-route-products-detail__accordion-text-wrapper--about",.4,{height:0}),this.isAboutAccordionExpanded=!0)},thumbnailClick:function(a){this.currentImageIndex=a},toggleAccordian:function(a,b){"about"===b?this.isAboutAccordionExpanded?(TweenLite.to(a,.4,{height:0}),this.isAboutAccordionExpanded=!1):(TweenLite.set(a,{height:"auto"}),TweenLite.from(a,.4,{height:0}),this.isAboutAccordionExpanded=!0):"legal"===b&&(this.isLegalAccordionExpanded?(TweenLite.to(a,.4,{height:0}),this.isLegalAccordionExpanded=!1):(TweenLite.set(a,{height:"auto"}),TweenLite.from(a,.4,{height:0}),this.isLegalAccordionExpanded=!0))}}),computed:Object.assign({},Vuex.mapState("storeSelector",["inventories","popUp","selectedStore"]),{relatedProductTiles:function(){return this.relatedProducts.map(function(a){var b;return b=""!==a.BuyNowLink?{url:a.BuyNowLink,urlLabel:e.BuyNowLabel,urlTarget:"_blank",target:"_blank",isUrlAbsolute:!0,isAbsolute:!0}:{url:"/products/"+a.Id+window.location.search,urlLabel:e.ProductCTALabel,urlTarget:"_self",isUrlAbsolute:!1,isAbsolute:!1},{componentKey:a.Id+Math.round(1e6*Math.random()),cta:b,inventory:{stockCountLabel:e.InventoryCountLabel,checkStockCountLabel:e.CheckAvailabilityLabel,checkOtherStockCountlabel:e.CheckOtherStoresLabel},product:{id:a.Id,image:{alt:a.Images&&a.Images.length>0&&a.Images[0].ImageAltText?a.Images[0].ImageAltText:a.Title,url:a.Images&&a.Images.length>0?a.Images[0].Url:""},link:b,pwr:{id:"pwr-snippet-"+a.Id},tags:a.Tags,title:a.Title,offer:a.OfferShortText}}},this)}}),watch:{$route:function(){this.initProducts()}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Spring2021.VueRoutes"),d=b.resolve("SDM.Vue.Widgets");c.Contest={template:"#module-spring-2021-route-contest",components:{"pop-up":d.PopUp},props:{},data:function(){return{isPopUpErrorVisible:!1,isPopUpSubmissionVisible:!0,isPopUpCompletionVisible:!1,isPrize1Collapsed:!0,isPrize2Collapsed:!0,isPrize3Collapsed:!0,isSubmissionLoading:!1,submissionTelephone:""}},created:function(){},mounted:function(){},methods:{initializeSubmissionPopUp:function(){this.submissionTelephone="",this.isPopUpSubmissionVisible=!0,this.isPopUpCompletionVisible=!1,this.isPopUpErrorVisible=!1},checkSubmissionTelephone:function(){return this.isSubmissionTelephoneValid?(this.isPopUpSubmissionVisible=!0,this.isPopUpErrorVisible=!1,!0):(this.isPopUpSubmissionVisible=!1,this.isPopUpErrorVisible=!0,!1)},showPopUp:function(){this.initializeSubmissionPopUp(),this.$refs.popUpContestSubmission.showPopUp()},submitContest:function(a,b,c){if(this.$refs.submissionForm.checkValidity()&&this.checkSubmissionTelephone()){var d=this.submissionTelephone.replace(/[()-.]/g,"");this.isSubmissionLoading=!0;var e=JSON.stringify({PhoneNumber:d,ShortCode:c,TriggerID:b});$.ajax({method:"POST",contentType:"application/json",url:"/global/submitphoneto3c",data:e,dataType:"json",headers:{__RequestVerificationToken:a}}).done(function(a){"OK"===a.status?(this.isPopUpSubmissionVisible=!1,this.isPopUpCompletionVisible=!0):(this.isPopUpSubmissionVisible=!1,this.isPopUpErrorVisible=!0,console.log("ERROR: "),console.log(a.message))}.bind(this)).fail(function(a){this.isPopUpSubmissionVisible=!1,this.isPopUpErrorVisible=!0,console.log("ERROR: "),console.log(a)}.bind(this)).always(function(){this.isSubmissionLoading=!1}.bind(this))}else this.$refs.submissionForm.reportValidity()}},computed:{isSubmissionTelephoneValid:function(){return""!==this.submissionTelephone&&null!==this.submissionTelephone.match(/^[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}$/im)}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Spring2021.VueRoutes"),d=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents");c.Meditations={template:"#module-spring-2021-meditations",name:"RouteMeditations",components:{"video-modal":d.Video}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Util"),e=b.resolve("SDM.Vue.Stores"),f=b.resolve("SDM.Vue.Modules.Spring2021.VueComponents"),g=b.resolve("SDM.Vue.Modules.Spring2021.VueRoutes"),h=b.resolve("SDM.Data.Spring2021");c.Spring2021=function(){var a=new VueRouter({base:"/"+d.getShortLanguageCode()+"/self-care/",mode:"history",routes:[{component:g.Home,name:"RouteHome",path:"/"},{component:g.Products,name:"RouteProducts",path:"/products"},{component:g.ProductsDetail,name:"RouteProductDetail",path:"/products/:productId"},{component:g.Contest,name:"RouteContest",path:"/contest"},{component:g.Meditations,name:"RouteMeditations",path:"/meditations-and-more"}],scrollBehavior:function(a,b){if(!a.query.v&&!b.query.v)return{x:0,y:0}}}),b=new Vuex.Store({state:function(){return{theme:[]}},modules:{storeSelector:e.StoreSelector}});new Vue({components:{hero:f.Hero,navigation:f.Navigation,"footer-menu":f.Footer},el:"#module-spring-2021",methods:Object.assign({},Vuex.mapActions("storeSelector",{setInventories:"setInventories"}),{}),mounted:function(){this.setInventories(h.Inventories.Stores)},router:a,store:b})}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.Summer2021.VueComponents").BadgeCta={computed:{},data:function(){return{}},methods:{},mounted:function(){},props:{badge:{type:Object,default:null}},template:"#module-summer-2021-badge-cta",updated:function(){},watch:{}}}(this,this.jQuery),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.Summer2021.VueComponents").FooterMenu={computed:{},data:function(){return{}},methods:{},mounted:function(){},props:{},template:"#module-summer-2021-footer-menu",updated:function(){},watch:{}}}(this,this.jQuery),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.Summer2021.VueComponents").Hero={template:"#summer-2021-hero-template",props:{baseBackgroundColor:String,featuredBadges:Object,themesModel:Array,ttwBackgroundColor:String},data:function(){return{currentCategory:"",currentSection:"",headerHexColor:"",heroImage:"",heroImageMobile:"",toPath:"",fromPath:"",themeModel:{},isTextToWin:!1}},created:function(){this.updateCurrentSection()},mounted:function(){},methods:{updateCurrentSection:function(){this.$route.path.split("/").filter(String)[0]?this.currentSection=this.$route.path.split("/").filter(String)[0].toLowerCase():this.currentSection="/"}},watch:{$route:function(a,b){this.toPath=a.path,this.fromPath=b.path,this.updateCurrentSection()}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Summer2021.VueComponents"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Data.Summer2021");c.Navigation={template:"#module-summer-2021-navigation",components:{navigation:d.Navigation},data:function(){return{menuLabel:e.MobileMenuLabel,menuOpenLabel:e.MobileMenuOpenLabel,menuCloseLabel:e.MobileMenuCloseLabel,links:[]}},mounted:function(){this.links.push({isAbsolute:!1,label:e.HomeTabLabel,target:"",url:"/"});for(var a=0;a640?(TweenLite.set(".module-summer-2021-products__filters-container",{height:"auto"}),this.isFiltersActive=!1,this.isFiltersMobile=!1):this.isFiltersMobile||(TweenLite.set(".module-summer-2021-products__filters-container",{height:0}),this.isFiltersActive=!1,this.isFiltersMobile=!0)},getCategoriesFromProducts:function(a){return a.reduce(function(a,b){return b.SubThemes.forEach(function(b){-1===a.findIndex(function(a){return a===b.TitleSlug})&&a.push(b)}),a},[]).map(function(a){return this.categories.find(function(b){if(b.TitleSlug===a)return b})}.bind(this)).sort(function(a,b){return a.Titleb.Title?1:0})},showHideFilter:function(){this.isFiltersActive?(TweenLite.to(".module-summer-2021-products__filters-container",.3,{height:0}),this.isFiltersActive=!1):(TweenLite.set(".module-summer-2021-products__filters-container",{height:"auto"}),TweenLite.from(".module-summer-2021-products__filters-container",.3,{height:0}),this.isFiltersActive=!0)},initialize:function(){this.selectedCategories=[]},loadMoreProducts:function(){g.scrollTo$ElementAsync(h(this.$refs.loadMoreButton),500),this.currentPageNumber=this.currentPageNumber+1},updateUrlParam:function(){var a={};this.selectedCategories.length>0&&(a=Object.assign({},a,{categories:this.selectedCategories.join(",")})),this.selectedBrands.length>0&&(a=Object.assign({},a,{brands:this.selectedBrands.join(",")})),console.log(a)}},computed:{filterdProducts:function(){return _.shuffle(this.productsByGroup.filter(function(a){return 0===this.selectedCategories.length||a.SubThemes.reduce(function(a,b){return a||this.selectedCategories.includes(b)}.bind(this),!1)}.bind(this)))},filterdProductsByCategories:function(){return this.productsByGroup.filter(function(a){return 0===this.selectedCategories.length||a.SubThemes.reduce(function(a,b){return a||this.selectedCategories.includes(b)}.bind(this),!1)}.bind(this))},productTiles:function(){return this.filterdProducts.map(function(a){return this.componentKey++,{type:"product",productTile:{cta:{url:a.BuyNowLink?a.BuyNowLink:this.$route.path+"/"+a.Id+window.location.search,urlLabel:a.BuyNowLink?f.BuyNowLabel:f.ProductCTALabel,urlTarget:a.BuyNowLink?"_blank":"_self",isUrlAbsolute:!!a.BuyNowLink},inventory:{stockCountLabel:f.InventoryCountLabel,checkStockCountLabel:f.CheckAvailabilityLabel,checkOtherStockCountlabel:f.CheckOtherStoresLabel},product:{id:a.Id,image:{alt:a.Title+".",url:a.Images&&a.Images.length>0?a.Images[0].ImageRegularDef:""},link:{url:this.$route.path+"/"+a.Id+window.location.search,target:"_self",isAbsolute:!1},tags:a.Tags,title:a.Title,offer:a.OfferShortText}}}},this)},productsByGroup:function(){return Object.keys(this.products).reduce(function(a,b){return this.products[b]&&this.products[b].ProductGroup===this.productGroup&&a.push(this.products[b]),a}.bind(this),[])},inventory:function(){return{stockCountLabel:f.InventoryCountLabel,checkStockCountLabel:f.CheckAvailabilityLabel,checkOtherStockCountlabel:f.CheckOtherStoresLabel}},productGrid:function(){var a=this.currentPageNumber*this.productPerPage;return this.productTiles.slice(0,a)},totalPageNumber:function(){var a=this.productTiles.length;return Math.ceil(a/this.productPerPage)}},watch:{filterdProducts:function(){this.currentPageNumber=1},productsByGroup:function(){this.filteredProductsCategories=this.getCategoriesFromProducts(this.productsByGroup)},productGroup:function(){this.initialize()}}}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules.Summer2021.VueComponents").ShopIcons={template:"#module-summer-2021-shop-icons"}}(this,this.jQuery),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Summer2021.VueComponents"),d=b.resolve("SDM.Vue.Mixins");c.Video={template:"#module-summer-2021-video",props:{videoData:Array},data:function(){return{isModalActive:!1}},mixins:[d.LockFocus],mounted:function(){this.$route.query.v&&this.initVideo(this.$route.query.v)},methods:{initVideo:function(a){var b=this.findObjectByKey(this.videoData,"TitleSlug",a);b&&this.onVideoThumbnailClick(b.YouTubeVideoID,b.Title)},onVideoThumbnailClick:function(a,b){this.isModalActive=!0,document.body.style.overflow="hidden",document.querySelector("#module-summer-2021-video-embed__video").innerHTML='',TweenMax.to(".module-summer-2021-video-embed",.4,{opacity:1}),setTimeout(function(){document.getElementById("module-summer-2021-video-embed__close").focus()},1e3)},onCloseVideo:function(){if(this.isModalActive){var a=this;TweenMax.to(".module-summer-2021-video-embed",.3,{opacity:0,onComplete:a.closeVideo})}},closeVideo:function(){this.isModalActive=!1,document.body.style.overflow="auto",document.querySelector("#module-summer-2021-video-embed__video").innerHTML=""},findObjectByKey:function(a,b,c){for(var d=0;db;b++)for(var c=0;this.badgeCarousels[b].slides.length>c;c++){var d={api_key:g.PowerReviewsApiKey,locale:g.PowerReviewsLocale,merchant_group_id:g.PowerReviewsMerchantGroupId,merchant_id:g.PowerReviewsMerchantId,page_id:this.badgeCarousels[b].slides[c].id,components:{CategorySnippet:this.badgeCarousels[b].slides[c].pwr.id}};a.push(d)}pwr("render",a)}},components:{badgeCta:c.BadgeCta,carousel:f.ProductCarousel,"store-selector":f.StoreSelector,"video-modal":c.Video},computed:{badgeCarousels:function(){var a=!0;return this.categories.map(function(b){a=!a;var c=b.FeaturedProducts.map(function(a){var c={};return c=""!==a.BuyNowLink?{url:a.BuyNowLink,urlTarget:"_blank",target:"_blank",isUrlAbsolute:!0,isAbsolute:!0}:{url:"/products/"+a.Id+"?themes="+b.ThemeKey,urlTarget:"_self",isUrlAbsolute:!1},{id:a.Id,image:{url:a.Images&&a.Images.length>0?a.Images[0].Url:"",alt:a.Title},inventory:{stockCountLabel:g.InventoryCountLabel,checkStockCountLabel:g.CheckAvailabilityLabel,checkOtherStockCountlabel:g.CheckOtherStoresLabel},link:c,pwr:{id:"pwr-snippet-"+a.Id},text1:a.OfferShortText,text2:a.Title,text3:"",tags:a.Tags}},this);return{badge:{heading:b.CarouselText,hexColorBg:b.CarouselBackgroundHex,hexColorFont:b.CarouselFontHex,hexColorCta:b.FeaturedCarouselButtonBgHex,hexColorCtaLabel:b.CarouselButtonFontHex,text:"",cta:{url:"/products?themes="+b.ThemeKey,label:g.ExploreLabel,isUrlAbsolute:!1}},slides:c,isBadgeOnLeft:!this.isDesktopLarge||a}},this)},hideCategories:function(){this.isCategoriesActive=!1},bottomBadges:function(){return this.bottomBadgesData.map(function(a){return{image:{alt:this.isDesktop||this.isDesktopLarge?a.DesktopImageAltText:a.MobileImageAltText,url:this.isDesktop||this.isDesktopLarge?a.DesktopImage:a.MobileImage},link:{isAbsolute:!1,target:a.CTALinkTarget,url:a.CTALink},youTubeVideoId:a.YouTubeVideoID,youTubeVideoCta:a.TitleSlug}},this)},tileBadges:function(){return this.homeBadges.map(function(a){return{image:{alt:this.isDesktop||this.isDesktopLarge?a.DesktopImageAltText:a.MobileImageAltText,url:this.isDesktop||this.isDesktopLarge?a.DesktopImage:a.MobileImage},link:{label:a.Title,target:a.CTALinkTarget,url:a.CTALink}}},this)}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules.Summer2021.VueRoutes"),d=b.resolve("SDM.Vue.Widgets");c.Contest={template:"#module-summer-2021-route-contest",components:{"pop-up":d.PopUp},props:{},data:function(){return{isPopUpErrorVisible:!1,isPopUpSubmissionVisible:!0,isPopUpCompletionVisible:!1,isPrize1Collapsed:!0,isPrize2Collapsed:!0,isPrize3Collapsed:!0,isSubmissionLoading:!1,submissionTelephone:""}},created:function(){},mounted:function(){},methods:{initializeSubmissionPopUp:function(){this.submissionTelephone="",this.isPopUpSubmissionVisible=!0,this.isPopUpCompletionVisible=!1,this.isPopUpErrorVisible=!1},checkSubmissionTelephone:function(){return this.isSubmissionTelephoneValid?(this.isPopUpSubmissionVisible=!0,this.isPopUpErrorVisible=!1,!0):(this.isPopUpSubmissionVisible=!1,this.isPopUpErrorVisible=!0,!1)},showPopUp:function(){this.initializeSubmissionPopUp(),this.$refs.popUpContestSubmission.showPopUp()},submitContest:function(a,b,c){if(this.$refs.submissionForm.checkValidity()&&this.checkSubmissionTelephone()){var d=this.submissionTelephone.replace(/[()-.]/g,"");this.isSubmissionLoading=!0;var e=JSON.stringify({PhoneNumber:d,ShortCode:c,TriggerID:b});$.ajax({method:"POST",contentType:"application/json",url:"/global/submitphoneto3c",data:e,dataType:"json",headers:{__RequestVerificationToken:a}}).done(function(a){"OK"===a.status?(this.isPopUpSubmissionVisible=!1,this.isPopUpCompletionVisible=!0):(this.isPopUpSubmissionVisible=!1,this.isPopUpErrorVisible=!0,console.log("ERROR: "),console.log(a.message))}.bind(this)).fail(function(a){this.isPopUpSubmissionVisible=!1,this.isPopUpErrorVisible=!0,console.log("ERROR: "),console.log(a)}.bind(this)).always(function(){this.isSubmissionLoading=!1}.bind(this))}else this.$refs.submissionForm.reportValidity()}},computed:{isSubmissionTelephoneValid:function(){return""!==this.submissionTelephone&&null!==this.submissionTelephone.match(/^[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}$/im)}}}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Widgets"),d=b.resolve("SDM.Vue.Modules.Summer2021.VueRoutes"),e=b.resolve("SDM.Data.Summer2021");d.ProductsDetail={data:function(){return{componentKey:0,currentImageIndex:0,isAboutAccordionExpanded:!0,isLegalAccordionExpanded:!1,product:{},relatedProducts:[]}},name:"RouteProductsDetail",template:"#module-summer-2021-route-products-detail",components:{productTile:c.ProductTile,"store-selector-modal":c.StoreSelectorModal},mounted:function(){this.initProducts()},methods:Object.assign({},Vuex.mapActions("storeSelector",["setProductImageUrl","setProductHeading","setProductSubheading","setProductUpc"]),{initProducts:function(){TweenLite.to(".module-summer-2021-route-products-detail",.2,{opacity:0});var a={CampaignTitle:"Summer_2021",CampaignRoute:"summer",Upc:this.$route.params.productId},b=this;$.ajax({method:"POST",url:"/"+e.Lang+"/GetSummer2021ProductDetails",data:a,dataType:"json",headers:{__RequestVerificationToken:e.FormToken}}).done(_.bind(function(a){b.product=a.Product,b.relatedProducts=a.RelatedProducts,TweenLite.to(".module-summer-2021-route-products-detail",.4,{opacity:1,delay:.2})},this)).fail(function(a){console.log(a)})},checkAvailability:function(a){this.setProductImageUrl(a.Images&&a.Images.length>0?a.Images[0].Url:""),this.setProductHeading(a.Title),this.setProductUpc(a.Id),this.popUp.showPopUp()},goBack:function(){this.$router.replace("/"+this.$route.params.category+window.location.search)},toggleAboutAccordian:function(){this.isAboutAccordionExpanded?(TweenLite.to(".module-summer-2021-route-products-detail__accordion-text-wrapper--about",.4,{height:0}),this.isAboutAccordionExpanded=!1):(TweenLite.set(".module-summer-2021-route-products-detail__accordion-text-wrapper--about",{height:"auto"}),TweenLite.from(".module-summer-2021-route-products-detail__accordion-text-wrapper--about",.4,{height:0}),this.isAboutAccordionExpanded=!0)},thumbnailClick:function(a){this.currentImageIndex=a},toggleAccordian:function(a,b){"about"===b?this.isAboutAccordionExpanded?(TweenLite.to(a,.4,{height:0}),this.isAboutAccordionExpanded=!1):(TweenLite.set(a,{height:"auto"}),TweenLite.from(a,.4,{height:0}),this.isAboutAccordionExpanded=!0):"legal"===b&&(this.isLegalAccordionExpanded?(TweenLite.to(a,.4,{height:0}),this.isLegalAccordionExpanded=!1):(TweenLite.set(a,{height:"auto"}),TweenLite.from(a,.4,{height:0}),this.isLegalAccordionExpanded=!0))}}),computed:Object.assign({},Vuex.mapState("storeSelector",["inventories","popUp","selectedStore"]),{relatedProductTiles:function(){return this.relatedProducts.map(function(a){return this.componentKey++,{cta:{url:"/"+this.$route.params.category+"/"+a.Id,urlLabel:e.ProductCTALabel,urlTarget:"_self",isUrlAbsolute:!1},inventory:{stockCountLabel:e.InventoryCountLabel,checkStockCountLabel:e.CheckAvailabilityLabel,checkOtherStockCountlabel:e.CheckOtherStoresLabel},product:{id:a.Id,image:{alt:a.Images&&a.Images.length>0&&a.Images[0].ImageAltText?a.Images[0].ImageAltText:a.Title,url:a.Images&&a.Images.length>0?a.Images[0].Url:""},link:{url:"/"+this.$route.params.category+"/"+a.Id,target:"_self",isAbsolute:!1},tags:a.Tags,title:a.Title,offer:a.OfferShortText}}},this)}}),watch:{$route:function(){this.initProducts()}}}}(this),function(a){"use strict";var b=a.NR,c=SDM.Data.Summer2021,d=b.resolve("SDM.Vue.Modules.Summer2021.VueComponents"),e=b.resolve("SDM.Vue.Modules.Summer2021.VueRoutes"),f=b.resolve("SDM.Vue.Mixins"),g=b.resolve("SDM.Vue.Widgets");e.SummerSwitchUp={template:"#module-summer-2021-route-summer-switch-up",mixins:[f.Responsive],components:{"store-selector":g.StoreSelector,"products-grid":d.Products,"video-modal":d.Video},data:function(){return{themeData:{}}},created:function(){this.themeData=this.findObjectByKey(c.TabsJson,"ThemeKey","summer-switch-up")},methods:{findObjectByKey:function(a,b,c){for(var d=0;d0&&c(this.$refs.carouselProduct).slick({infinite:!0,lazyLoad:"ondemand",slidesToScroll:1,slidesToShow:4,responsive:[{breakpoint:769,settings:{slidesToShow:2,swipeToSlide:!0}},{breakpoint:480,settings:{slidesToShow:1,swipeToSlide:!0}}]})},initializeCarouselShare:function(){c(this.$refs.carouselShare).length>0&&(console.log("Carousel called"),c(this.$refs.carouselShare).on("afterChange",function(){this.currentSocialBadgeIndex=c(this.$refs.carouselShare).slick("slickCurrentSlide")}.bind(this)),c(this.$refs.carouselShare).slick({infinite:!0,lazyLoad:"ondemand",slidesToScroll:1,slidesToShow:1,responsive:[{breakpoint:769,settings:{slidesToShow:1,swipeToSlide:!0}}]}))},initializeSocial:function(){POWERREVIEWS.display.render({api_key:"f40b12ae-7efa-423a-8f12-cb902debf1c0",locale:"en_CA",merchant_id:"867678",irlSubtype:"XL",components:{IRLSnippet:"module-shoebox__social"}})},setDonationAmount:function(a,b){var e=parseFloat(a)>0?a:"",f=parseInt(b)>0?b:"";this.setMoneyAmount(e),localStorage.setItem("donationMoneyAmount",e),this.setPcOptimumAmount(f),localStorage.setItem("donationPointsAmount",f),this.activeDonationStep++,d.scrollTo$ElementAsync(c(this.$refs.sectionDonate),500,this.navHeight)}}),mounted:function(){this.initializeCarousel(),this.initializeSocial();var a=d.getUrlVars();a&&"points"===a.type?this.goToDonationStep(2):a&&"introduction"===a.step&&this.goToDonationStep(1),this.socialBadges.forEach(function(a){this.fetchBadgeDataUrl(a)}.bind(this))},store:a,watch:{activePanel:function(a){a===this.panels.completion?this.showDonationCompletion=!0:a===this.panels.confirmation?(this.activeDonationStep=3,this.totalDonationSteps=3):a===this.panels.points||a===this.panels.pcoptimum||a===this.panels.money?(this.activeDonationStep=2,this.totalDonationSteps=3):this.activeDonationStep=1},showDonationCompletion:function(){var a=this;setTimeout(function(){a.initializeCarouselShare()},50)}}})}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Util");c.StickyNavigation=function(){new Vue({data:function(){return{isNavActive:!1,isNavSticky:!1}},el:"#module-sticky-navigation",methods:{onResize:function(){this.headerHeight=this.$refs.navLogo.clientHeight,this.stickHeader()},onScroll:function(){this.stickHeader()},stickHeader:function(){var a=d.getHeaderBarHeight(),b=window.pageYOffset||document.documentElement.scrollTop;Math.max(document.documentElement.clientWidth,window.innerWidth||0)<=960&&(a=0),this.isNavSticky=b>=a},toggleNav:function(){this.isNavActive=!this.isNavActive,this.isNavActive?document.body.style.overflow="hidden":document.body.style.overflow="visible",this.stickHeader()},toggleNavOff:function(){this.isNavActive=!1,document.body.style.overflow="visible",this.stickHeader()},isNavUrlActive:function(a){return new URL(a,window.location.origin).pathname===window.location.pathname}},mounted:function(){this.headerHeight=this.$refs.navLogo.clientHeight,window.addEventListener("scroll",this.onScroll),window.addEventListener("resize",_.debounce(this.onResize,100))}})}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Core.Modules"),d=b.resolve("SDM.Util");c.ArticleDetails=function(a){new Vue({components:{},created:function(){},data:function(){return{}},el:a,methods:{shareFacebook:function(){FB.ui({display:"popup",href:window.location.href,method:"share"})}},mounted:function(){if(d.getUrlVars().parentUrl&&window.history.replaceState({},document.title,window.location.pathname),this.$refs.productsCarousel){var a=this.$refs.productsCarousel.children.length||0;a<=2||$(this.$refs.productsCarousel).slick({nextArrow:'',prevArrow:'',responsive:[{breakpoint:769,settings:{slidesToShow:Math.min(a,2)}}],slidesToShow:Math.min(a,4)})}},watch:{}})}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Util");c.StickyPromotionBar=function(){new Vue({data:function(){return{isNavSticky:!1}},el:"#module-sticky-promotion-bar",methods:{onResize:function(){this.stickHeader()},onScroll:function(){this.stickHeader()},stickHeader:function(){var a=d.getHeaderBarHeight(),b=window.pageYOffset||document.documentElement.scrollTop;Math.max(document.documentElement.clientWidth,window.innerWidth||0)<=960&&(a=0),this.isNavSticky=b>=a},toggleNav:function(){this.isNavActive=!this.isNavActive,this.isNavActive?document.body.style.overflow="hidden":document.body.style.overflow="visible",this.stickHeader()},toggleNavOff:function(){this.isNavActive=!1,document.body.style.overflow="visible",this.stickHeader()},isNavUrlActive:function(a){return new URL(a,window.location.origin).pathname===window.location.pathname}},mounted:function(){window.addEventListener("scroll",this.onScroll),window.addEventListener("resize",_.debounce(this.onResize,100))}})}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules.WomensHealth.VueComponents"),d=a._,e=a.$;c.Carousel={beforeDestroyed:function(){var b=e(a);b.off("becometonarrow becometowide",this.boundOnBecomeToNarrow),b.off("becometosmalldesktopwide becometoextrawide",this.boundOnBecomeToWide),b.off("resize",this.boundOnResize)},computed:{canMoveLeft:function(){return this.offsetLeftFactor>0},canMoveRight:function(){return this.offsetLeftFactor=0},isMoneyAmountValid:function(){var a=/^[1-9]\d*$/;return""!==this.moneyAmount&&this.moneyAmount>=parseFloat(e.MinimumDollarAmount)&&this.moneyAmount.search(a)>=0},isPCOptimumAmountValid:function(){var a=/^[1-9]\d*$/;return""!==this.pcOptimumAmount&&this.pcOptimumAmount>=parseFloat(e.MinimumPointAmount)&&this.pcOptimumAmount.search(a)>=0},isTreeModalVisible:function(){return(this.isWelcomeModalVisible||this.isTreeDetailModalVisible)&&this.activeTreeStep===this.treeSteps.growingTree&&!this.isDonationStepVisible}}),directives:{focus:{inserted:function(a){a.focus()}}},data:function(){return{activeAvatar:null,activeAvatarPlayer:null,activeDonationStep:1,activeDonationAmountStep:"",activeModalPartnerDetail:null,activeModalShelterDetail:null,activeTreeStep:"",address:{firstName:"",lastName:"",email:"",address1:"",address2:"",city:"",province:"",postalCode:""},avatars:e.Avatars,branches:e.Branches,donationLocation:"",donationName:"",donationTypes:{money:"money",points:"points"},isDonationLocationDropdownActive:!1,isLoaderVisible:!1,isPCOptimumErrorVisible:!1,isTreeDetailModalVisible:!1,isWelcomeModalVisible:!0,donationSteps:{amount:1,personalize:2,preview:3,confirmation:4},donationAmountSteps:{introduction:"introduction",points:"points",money:"money",pcoptimum:"pcoptimum",address:"address",confirmation:"confirmation",completion:"completion"},moneyAmount:"",partners:e.Partners,pcOptimumAmount:"",pcOptimumPointsPerDollar:1e3,selectedDonationType:"",shelters:e.Shelters,signature:"",tree:e.Tree,treeSteps:{growingTree:"growingTree",community:"community"}}},methods:Object.assign({},Vuex.mapActions("womensHealth",["setIsDonationStepVisible","setIsRedirectingModalStep"]),{checkDonationName:function(){this.isNameValid?this.$refs.formDonationName.setCustomValidity(""):this.$refs.formDonationName.setCustomValidity(e.InitialsErrorMessage)},clickOutside:function(){this.activeDonationStep===this.donationSteps.confirmation&&this.initializeData()},completeDonation:function(){this.initializeData(),this.setIsDonationStepVisible(!1)},convertDonationNameToUppercase:function(){this.donationName=this.donationName.toUpperCase()},formatToCurrency:function(a){var b=d.getShortLanguageCode(),c=parseFloat(a).toFixed(2).split("."),e=c[0],f=c[1];return"en"===b?"$"+(e=e.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"))+"."+f:"fr"===b?(e=e.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1 "))+","+f+" $":void 0},donatePCOptimumPoints:function(){this.isLoaderVisible=!0,$.ajax({context:this,data:{points:this.pcOptimumAmount},method:"POST",url:"/Brooklyn/Donate"}).done(function(a,b){"success"===b&&"202"===a?this.activeDonationAmountStep=this.donationAmountSteps.completion:(this.isPCOptimumErrorVisible=!0,console.log("ERROR:"+a))}).fail(function(a){console.log(a),this.isPCOptimumErrorVisible=!0}).always(function(){this.isLoaderVisible=!1})},getFormDataAsObject:function(a){for(var b=$(a).serializeArray(),c={},d=0;d57)&&46!==b&&8!==b&&a.preventDefault()},onDonationNextClick:function(){this.isDonationStepVisible&&(this.activeDonationStep===this.donationSteps.amount?this.activeDonationAmountStep===this.donationAmountSteps.introduction?this.selectedDonationType===this.donationTypes.points?this.activeDonationAmountStep=e.IsLoggedIn?this.donationAmountSteps.points:this.donationAmountSteps.pcoptimum:this.selectedDonationType===this.donationTypes.money&&(this.activeDonationAmountStep=this.donationAmountSteps.money):this.activeDonationAmountStep===this.donationAmountSteps.points?this.donatePCOptimumPoints():this.activeDonationAmountStep===this.donationAmountSteps.money?this.activeDonationAmountStep=this.donationAmountSteps.address:this.activeDonationAmountStep===this.donationAmountSteps.address?this.submitPayment():this.activeDonationAmountStep===this.donationAmountSteps.completion&&(this.activeDonationStep+=1):this.activeDonationStep===this.donationSteps.preview?(this.checkDonationName(),this.$refs.formDonationPreview.checkValidity()?this.submitGivingTreeDonation():this.$refs.formDonationPreview.reportValidity()):this.activeDonationStep+=1)},onDonationPreviousClick:function(){this.isDonationStepVisible&&(this.activeDonationStep===this.donationSteps.amount?this.activeDonationAmountStep===this.donationAmountSteps.introduction?this.setIsDonationStepVisible(!1):this.activeDonationAmountStep===this.donationAmountSteps.points?this.activeDonationAmountStep=this.donationAmountSteps.introduction:this.activeDonationAmountStep===this.donationAmountSteps.money?this.activeDonationAmountStep=this.donationAmountSteps.introduction:this.activeDonationAmountStep===this.donationAmountSteps.pcoptimum?this.activeDonationAmountStep=this.donationAmountSteps.introduction:this.activeDonationAmountStep===this.donationAmountSteps.address?this.activeDonationAmountStep=this.donationAmountSteps.money:this.activeDonationAmountStep===this.donationAmountSteps.confirmation&&(this.activeDonationAmountStep=this.donationAmountSteps.address):this.activeDonationStep-=1)},pauseAvatar:function(a,b){this.activeAvatar&&this.activeAvatar.AvatarID===b||a.target.pause()},playAvatar:function(a,b){this.activeAvatar&&this.activeAvatar.AvatarID===b||a.target.play()},clearUrlParams:function(){var a="";a=-1===window.location.href.indexOf("?")?window.location.href:window.location.href.slice(0,window.location.href.indexOf("?")),history.pushState&&window.history.pushState("",null,a)},setActiveAvatar:function(a,b){null!==this.activeAvatarPlayer&&this.activeAvatarPlayer.pause(),this.activeAvatarPlayer="lottie-player"===a.target.tagName.toLowerCase()?a.target:a.target.querySelectorAll("lottie-player")[0],this.activeAvatarPlayer.play(),this.activeAvatar=b},submitPayment:function(){this.$refs["form-address"].checkValidity()?(this.activeDonationAmountStep=this.donationAmountSteps.confirmation,Vue.nextTick(function(){this.getFrontStreamUrl()}.bind(this))):this.$refs["form-address"].reportValidity()},submitGivingTreeDonation:function(){this.isLoaderVisible=!0,$.ajax({context:this,data:{Initials:this.formattedDonationName,AvatarID:this.activeAvatar.AvatarID,DonationAmount:this.selectedDonationType===this.donationTypes.money?this.moneyAmount:this.pcOptimumAmount,DonationType:this.selectedDonationType===this.donationTypes.money?"d":"p",Location:this.donationLocation},headers:{__RequestVerificationToken:e.VerificationToken},method:"POST",url:"/WomensHealth/Submit"}).done(function(a,b){"success"===b?(this.tree.unshift(a),this.activeDonationStep+=1):console.log("ERROR:"+a)}).fail(function(a){console.log(a)}).always(function(){this.isLoaderVisible=!1})},hidePopUp:function(){this.$root.$emit("pop-up-closed-footer")},checkKeyEvent:function(a){if("Escape"===a.key)return this.isTreeDetailModalVisible=!1,void(this.isWelcomeModalVisible=!1);var b=this.$refs.modalContainer.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(b.length<2&&"Tab"===a.key)return void a.preventDefault();var c=b.length-1;"Tab"===a.key&&!1===a.shiftKey&&a.target===b[c]?(a.preventDefault(),b[0].focus()):"Tab"===a.key&&!0===a.shiftKey&&a.target===b[0]&&(a.preventDefault(),b[c].focus())}}),mounted:function(){this.activeTreeStep=this.treeSteps.growingTree,this.activeDonationStep=this.donationSteps.amount,this.activeDonationAmountStep=this.donationAmountSteps.introduction,window.addEventListener?window.addEventListener("message",function(a){e&&e.FrontStreamUrl&&e.FrontStreamUrl.includes(a.origin)&&("userCancelled"===a.data?this.activeDonationAmountStep=this.donationAmountSteps.address:(this.activeDonationStep=this.donationSteps.personalize,this.activeDonationAmountStep="",this.donationLocation=this.address.province))}.bind(this)):window.attachEvent&&window.attachEvent("onmessage",function(a){e&&e.FrontStreamUrl&&e.FrontStreamUrl.includes(a.origin)&&("userCancelled"===a.data?this.activeDonationAmountStep=this.donationAmountSteps.address:(this.activeDonationStep=this.donationSteps.personalize,this.activeDonationAmountStep="",this.donationLocation=this.address.province))}.bind(this))},name:"GivingTree",template:"#module-womens-health-giving-tree",watch:{isRedirectingModalStep:function(a){if(!0===a){var b=d.getUrlVars();b&&"points"===b.type&&(e.IsLoggedIn?(this.selectedDonationType=b.type,this.activeDonationAmountStep=this.donationAmountSteps.points):this.activeDonationAmountStep=this.donationAmountSteps.pcoptimum),this.setIsRedirectingModalStep(!1),this.clearUrlParams()}},isTreeModalVisible:function(a){a&&this.$nextTick(function(){this.$refs.modalContainer.focus()})}}}}(this),function(a){var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Util"),e=b.resolve("SDM.Vue.Modules.WomensHealth.VueComponents"),f=b.resolve("SDM.Vue.Widgets"),g=a.localStorage,h=b.resolve("SDM.Data.WomensHealth"),i=a._,j=a.$,k=function(a){if(!a)return null;try{var b=a.match(/href="([^"]*)"/i);if(!b||!b.length)return null;var c=a.match(/^<[^>]*>([^<]*)<\/a>$/i);if(!c||!c.length)return null;var d=a.match(/target="([^"]*)"/i);return{href:b[1],target:d&&d.length?d[1]:"",text:c[1]}}catch(b){return console.error("Could not parse URL:",a,b),null}};c.WomensHealth=function(){var a=new Vuex.Store({modules:{womensHealth:{actions:{setIsDonationStepVisible:function(a,b){a.commit("setIsDonationStepVisible",b)},setIsRedirectingModalStep:function(a,b){a.commit("setIsRedirectingModalStep",b)}},mutations:{setIsDonationStepVisible:function(a,b){a.isDonationStepVisible=b},setIsRedirectingModalStep:function(a,b){a.isRedirectingModalStep=b}},namespaced:!0,state:function(){return{isDonationStepVisible:!1,isRedirectingModalStep:!1}}}}});new Vue({components:{carousel:e.Carousel,"giving-tree":e.GivingTree,"pop-up":f.PopUp},computed:Object.assign({},Vuex.mapState("womensHealth",["isRedirectingModalStep"]),{}),created:function(){this.charitiesByProvinceId=i.reduce(this.partners,function(a,b){var c=(b.Province||"").toLowerCase();return c?(a[c]||(a[c]=[]),a[c].push({imageUrl:(b.Image||{}).URL,label:b.Title,url:k(b.Url)}),a):a},{}),this.shelters.length&&(this.featuredShelter={body:this.shelters[0].LongDescription||"",imageUrl:(this.shelters[0].LargeLogo||{}).URL||"",name:this.shelters[0].Name||""}),this.geoLocateUser()},data:function(){return{charitiesByProvinceId:{},charitiesWithImages:[],testimonials:h.Testimonials,charitiesWithoutImages:[],featuredShelter:null,isShowAdditionalCharities:!1,partners:h.Partners,selectedProvinceId:"",shelters:h.Shelters,socialBadges:i.map(i.filter(h.SocialImages||[],function(a){return Boolean(a.URL)}),function(a){return{downloadLink:{href:a.URL,target:"_blank"},label:a.Label||"",imageUrl:a.URL}})}},el:"#module-womens-health",methods:Object.assign({},Vuex.mapActions("womensHealth",["setIsDonationStepVisible","setIsRedirectingModalStep"]),{geoLocateUser:function(){var a=new j.Deferred;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(function(b){b&&b.coords&&b.coords.latitude&&b.coords.longitude?a.resolve({lat:b.coords.latitude,lng:b.coords.longitude}):a.reject("Failed to get lat/lng data")},function(b){console.error(b),a.reject("Failed to get response from navigator.geolocation")}):a.reject("No navigator.geolocation api"),j.when(a.promise()).then(function(a){return d.getProvinceId(a)}).then(i.bind(function(a){this.selectedProvinceId=a},this)).fail(function(a){console.error(a)})},showAdditionalCharities:function(){this.isShowAdditionalCharities=!0},showTreeModal:function(a){this.setIsDonationStepVisible(a),this.$refs.popUpTreeModal.showPopUp(),this.isRedirectingModalStep||g.removeItem("donationMoneyAmount"),this.$refs.givingTree.$refs.modalContainerCloseBtn&&this.$refs.givingTree.$refs.modalContainerCloseBtn.focus()}}),mounted:function(){var a=d.getUrlVars();a&&"points"===a.type&&(this.setIsRedirectingModalStep(!0),this.showTreeModal(!0))},store:a,watch:{selectedProvinceId:function(){var a=d.getShortLanguageCode(),b=i.reduce(this.charitiesByProvinceId[this.selectedProvinceId]||[],function(a,b){return Boolean(b.imageUrl)?a.withImages.push(b):a.withoutImages.push(b),a},{withImages:[],withoutImages:[]});b.withoutImages.length&&b.withImages.push({clickEvent:"view-all",label:"fr"===a?"Tout voir":"View All Charities",imageUrl:"/static/campaigns/womens-health/images/view-all-charities_"+("fr"===a?"fr":"en")+".png"}),this.charitiesWithImages=b.withImages,this.charitiesWithoutImages=b.withoutImages.sort(function(a,b){return a.labelb.label?1:0}),this.isShowAdditionalCharities=!1}}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Util");c.GlobalCtaList=function(a){var c=a.data("contentId"),f=b.resolve("SDM.Data.GlobalCTAList")[c],g=b.resolve("SDM.Vue.Vuex");g.hasModule("provinceSelector")||g.registerModule("provinceSelector",d.ProvinceSelector),new Vue({computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{}),data:function(){return{badges:f.Badges,sdmLocationProvinceId:""}},el:a[0],methods:{},mounted:function(){var a=JSON.parse(e.getValueFromCookie("sdm-location"));this.sdmLocationProvinceId=a&&a.province?a.province:""},store:g})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Widgets");c.FeaturedProductsCarousel=function(a){var c=b.resolve("SDM.Vue.Vuex");c.hasModule("storeSelector")||c.registerModule("storeSelector",d.StoreSelector),new Vue({el:"#"+a[0].id,store:c,components:{carousel:e.ProductCarousel,"store-selector":e.StoreSelector},props:{dataProducts:String},data:function(){return{categoryCarouselsSlidesToShow:{desktop:5,tablet:3,mobileLarge:2,mobile:2},products:[],showInventory:!1,checkAvailabilityLabel:"",checkOtherStoresLabel:"",detailsButtonLabel:"",inStoreLabel:"",ourStockLabel:"",shopButtonLabel:""}},mounted:function(){this.products=JSON.parse(this.$el.attributes["data-products"].value),this.checkAvailabilityLabel=this.$el.attributes["data-check-availability-label"].value,this.checkOtherStoresLabel=this.$el.attributes["data-check-other-stores-label"].value,this.detailsButtonLabel=this.$el.attributes["data-details-button-label"].value,this.inStoreLabel=this.$el.attributes["data-in-store-label"].value,this.ourStockLabel=this.$el.attributes["data-our-stock-label"].value,this.shopButtonLabel=this.$el.attributes["data-shop-button-label"].value,this.showInventory="False"===this.$el.attributes["data-hide-inventory"].value,this.showInventory&&this.setInventories(JSON.parse(this.$el.attributes["data-inventories"].value).Stores)},methods:Object.assign({},Vuex.mapActions("storeSelector",{setInventories:"setInventories"}),{}),computed:Object.assign({},Vuex.mapState("storeSelector",["inventories","popUp","selectedStore"]),{productsCarousel:function(){return{slides:this.products.map(function(a){var b={};return this.showInventory&&(b={stockCountLabel:this.inStoreLabel,checkStockCountLabel:this.checkAvailabilityLabel,checkOtherStockCountlabel:this.checkOtherStoresLabel,ourStockLabel:this.ourStockLabel}),{id:a.UpcStripped,image:{url:a.ImageUrl,alt:a.Title},cta:{isAbsolute:!0,label:a.UseBuyNowLabel?this.shopButtonLabel:this.detailsButtonLabel,target:a.ProductCTATarget,url:a.ProductCTA},link:{isAbsolute:!0,target:a.ProductCTATarget,url:a.ProductCTA},inventory:b,hasBuyNowLink:a.UseBuyNowLabel,text1:a.Brand,text2:a.Title,text3:a.Tag,title:a.Title}},this)}}}),watch:{}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Util"),e=b.resolve("SDM.Vue.Mixins"),f=b.resolve("SDM.Vue.Stores"),g=b.resolve("SDM.Vue.Widgets");c.DietitionNavigation=function(a){var c=a.data("contentId"),h=b.resolve("SDM.Data.DietitianNavigation")[c],i=b.resolve("SDM.Vue.Vuex");i.hasModule("provinceSelector")||i.registerModule("provinceSelector",f.ProvinceSelector),new Vue({el:a[0],mixins:[e.Responsive],created:function(){}, components:{"province-selector":g.ProvinceSelector},computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{filteredSlides:function(){return this.slides.filter(function(a){return a.provinces.includes(this.userProvinceId)}.bind(this))}}),data:function(){return{slides:h.Slides}},methods:{isUrlActive:function(a){var b=new URL(a,window.location.origin),c=b.pathname.split("/"+d.getShortLanguageCode()).pop();return window.location.pathname.split("/"+d.getShortLanguageCode()).pop()===c}},mounted:function(){},store:i,watch:{filteredSlides:function(){this.$refs.carousel&&(this.$refs.carousel.hasOwnProperty("slick")&&$(this.$refs.carousel).slick("unslick"),Vue.nextTick(function(){$(this.$refs.carousel).slick({arrows:!1,autoplay:!0,dots:!0})}.bind(this)))}}}),$(".module-dietitian-navigation__region-expand").on("click",function(){$("#module-dietitian-navigation__region-expand").hasClass("module-dietitian-navigation__region-expand--open")?setTimeout(function(){$("#module-dietitian-navigation__region-expand").removeClass("module-dietitian-navigation__region-expand--open"),$(".module-dietitian-navigation__region-expanded").removeClass("module-dietitian-navigation__region-expanded--open")},10):($(".module-dietitian-navigation__region-expanded").addClass("module-dietitian-navigation__region-expanded--open"),$("#module-dietitian-navigation__region-expand").addClass("module-dietitian-navigation__region-expand--open"))}),$(".module-dietitian-navigation__menu-mobilebutton").on("click",function(){$("#module-dietitian-navigation__header-nav").hasClass("module-dietitian-navigation__header-nav--open")?setTimeout(function(){$("#module-dietitian-navigation__header-nav").removeClass("module-dietitian-navigation__header-nav--open"),$(".module-dietitian-navigation__menu-hamburger").removeClass("module-dietitian-navigation__menu-hamburger--open")},10):($(".module-dietitian-navigation__menu-hamburger").addClass("module-dietitian-navigation__menu-hamburger--open"),$("#module-dietitian-navigation__header-nav").addClass("module-dietitian-navigation__header-nav--open"))}),$(".module-dietitian-navigation__recipe-btn").on("click",function(a){$(".module-dietitian-navigation__recipenav").hasClass("module-dietitian-navigation__recipenav--open")?($(".module-dietitian-navigation__recipenav").removeClass("module-dietitian-navigation__recipenav--open"),$(".downarrow").removeClass("downarrow--open"),$(".module-dietitian-navigation__recipe-expand").attr("aria-expanded","false")):($(".module-dietitian-navigation__recipenav").addClass("module-dietitian-navigation__recipenav--open"),$(".downarrow").addClass("downarrow--open"),$(".module-dietitian-navigation__recipe-expand").attr("aria-expanded","true"),a.preventDefault())}),$(document).on("click",function(a){$(a.target).closest(".module-dietitian-navigation__recipe-btn").length||($(".module-dietitian-navigation__recipenav").removeClass("module-dietitian-navigation__recipenav--open"),$(".downarrow").removeClass("downarrow--open"),$(".module-dietitian-navigation__recipe-expand").attr("aria-expanded","false"))})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Mixins");c.DietitionBiography=function(){var a=b.resolve("SDM.Vue.Vuex");a.hasModule("provinceSelector")||a.registerModule("provinceSelector",VueStores.ProvinceSelector),new Vue({el:"#module-dietitian-biography",computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{}),data:function(){return{}},mixins:[d.Responsive],mounted:function(){},store:a,updated:function(){$("#module-dietitian-biography .module-dietitian-biography__bio-entry").length<1&&$("#module-dietitian-biography").hide()}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Data.DietitionSocialFeed");c.DietitionSocialFeed=function(){new Vue({el:"#module-dietitian-socialfeed",methods:{initSocial:function(){POWERREVIEWS.display.render({api_key:d.ApiKey,locale:d.Locale,merchant_id:d.MerchantID,CD4_IRL_IMAGE_GALLERY_STYLE:d.GalleryStyle,components:{IRLSnippet:"module-dietitian-socialfeed__social"}})}},mounted:function(){this.initSocial()}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Widgets");c.FeaturedProductsCarouselWithBadge=function(a){var c=a.data("contentId"),f=b.resolve("SDM.Data.FeaturedProductsCarouselWidthBadges")[c],g=b.resolve("SDM.Vue.Vuex");g.hasModule("storeSelector")||g.registerModule("storeSelector",d.StoreSelector),new Vue({el:a[0],store:g,components:{carousel:e.ProductCarousel,"store-selector":e.StoreSelector},props:{dataProducts:String},data:function(){return{badgeRightAligned:!1,carouselSlides:[],categoryCarouselsSlidesToShow:{desktop:3,tablet:2,mobileLarge:2,mobile:2},checkAvailabilityLabel:"",checkOtherStoresLabel:"",detailsButtonLabel:"",inStoreLabel:"",ourStockLabel:"",products:[],shopButtonLabel:"",showInventory:!1}},mounted:function(){this.products=JSON.parse(f.Products),this.badgeRightAligned="True"===f.BadgeRightAligned,this.checkAvailabilityLabel=f.CheckAvailabilityLabel,this.checkOtherStoresLabel=f.CheckOtherStoresLabel,this.inStoreLabel=f.InStoreLabel,this.showInventory="False"===f.HideInventory,this.showInventory&&this.setInventories(JSON.parse(f.Inventory).Stores),this.initCarouselSlides();var a=this;setTimeout(function(){a.initPowerReviewSnippet()},3e3)},methods:Object.assign({},Vuex.mapActions("storeSelector",{setInventories:"setInventories"}),{initCarouselSlides:function(){this.carouselSlides=this.products.map(function(a){var b={};return this.showInventory&&(b={stockCountLabel:this.inStoreLabel,checkStockCountLabel:this.checkAvailabilityLabel,checkOtherStockCountlabel:this.checkOtherStoresLabel}),{id:a.UpcStripped,image:{url:a.ImageUrl,alt:a.Title},link:{isAbsolute:!0,target:a.ProductCTATarget,url:a.ProductCTA},inventory:b,InventoryHightlightColor:f.InventoryHighlightColor,InventoryIcon:f.InventoryIcon,hasBuyNowLink:a.UseBuyNowLabel,pwr:{id:"pw-snippet-"+c+a.ID,apiKey:f.PwrApiKey,merchantId:f.PwrMerchantId,merchantGroupId:f.PwrMerchantGroupId,locale:f.PwrLocale},text2:a.Title,text3:a.Tag,title:a.Title}},this)},initPowerReviewSnippet:function(){for(var a=this,b=0;this.carouselSlides.length>b;b++)null!==this.carouselSlides[b].pwr&&pwr("render",{api_key:a.carouselSlides[b].pwr.apiKey,locale:a.carouselSlides[b].pwr.locale,merchant_group_id:a.carouselSlides[b].pwr.merchantGroupId,merchant_id:a.carouselSlides[b].pwr.merchantId,page_id:a.carouselSlides[b].id,components:{CategorySnippet:a.carouselSlides[b].pwr.id}})}}),computed:Object.assign({},Vuex.mapState("storeSelector",["inventories","popUp","selectedStore"]),{carouselBadge:function(){return{heading:f.BadgeText,hexColorBg:f.BadgeBackgroundColorHex,hexColorFont:f.BadgeTextColorHex,hexColorCtaLabel:f.BadgeButtonLabelColorHex,hexColorCtaBg:f.BadgeButtonColorHex,text:"",cta:{url:f.BadgeButtonUrl,label:f.BadgeButtonLabel,urlTarget:f.BadgeButtonUrlTarget}}}})})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Data.TwoLevelNavigationMenu"),e=b.resolve("SDM.Util");c.TwoLevelNavigationMenu=function(a){new Vue({el:a[0],data:function(){return{currentPath:"",isNavActive:!1,links:[],menuLabel:"Menu",menuOpenLabel:"Open",menuCloseLabel:"Close"}},created:function(){this.menuItems=JSON.parse(d.MenuItems)},mounted:function(){this.currentPath=window.location.pathname},methods:{toggleNav:function(){this.isNavActive=!this.isNavActive,this.isNavActive?(document.body.style.overflow="hidden",e.scrollTo$ElementAsync($(this.$el),500)):document.body.style.overflow="visible"},toggleNavOff:function(){this.isNavActive=!1,document.body.style.overflow="visible"}}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Vue.Mixins"),f=b.resolve("SDM.Vue.Stores"),g=b.resolve("SDM.Data.ProductListingWithFeatureFilter"),h=b.resolve("SDM.Util");c.ProductListingWithFeatureFilter=function(a){var c=b.resolve("SDM.Vue.Vuex");c.hasModule("storeSelector")||c.registerModule("storeSelector",f.StoreSelector),new Vue({el:a[0],components:{"product-tile":d.ProductTile,"store-selector":d.StoreSelector},store:c,mixins:[e.Responsive],data:function(){return{componentKey:0,currentPageNumber:0,filteredProductsBrands:[],filteredProductsCategories:[],filteredProductsFeatures:[],isFiltersActive:!1,isFiltersMobile:!1,isFeatureFilterActive:!1,isLoading:!1,products:{},productGrid:[],routeBrands:"",routeCategories:"",routeFeatures:"",screenWidth:0,selectedBrands:[],selectedCategories:[],selectedFeatures:[],showInventory:!1,totalProductCount:0}},created:function(){this.showInventory="False"===g.InventoryHide,this.showInventory&&this.setInventories(JSON.parse(g.Inventory).Stores)},mounted:function(){this.getUrlVars(),this.routeBrands&&this.routeBrands.split(",").forEach(function(a){this.selectedBrands.push(a)},this),this.routeCategories&&this.routeCategories.split(",").forEach(function(a){this.selectedCategories.push(a)},this),this.routeFeatures&&this.routeFeatures.split(",").forEach(function(a){this.selectedFeatures.push(a)},this),this.getProducts(),window.addEventListener("resize",_.debounce(this.onResize,50)),this.onResize()},methods:Object.assign({},Vuex.mapActions("storeSelector",{setInventories:"setInventories"}),{getUrlVars:function(){this.routeBrands=h.getUrlVars().brands,this.routeCategories=h.getUrlVars().categories,this.routeFeatures=h.getUrlVars().features},getProducts:function(){this.isLoading=!0;var a={productListID:g.ProductListingId,randomize:g.RandomizeProducts,ppp:g.ProductsPerPage,pageNumber:this.currentPageNumber,brandFilters:this.routeBrands,categoryFilters:this.routeCategories,featureFilters:this.routeFeatures};$.ajax({method:"GET",url:"/"+g.Lang+"/product/GetFilteredProducts",data:a,dataType:"json",headers:{__RequestVerificationToken:g.FormToken}}).done(_.bind(function(a){this.currentPageNumber>0?this.products=this.products.concat(a.Products):this.products=a.Products,this.initFilters({categoryFilters:a.CatgoryFilters,brandFilters:a.BrandFilters,featureFilters:a.FeatureFilters}),this.totalProductCount=a.TotalProductCount,this.initProductGrid(),this.isLoading=!1},this)).fail(function(a){console.log(a)})},onBrandsFilterChange:function(){var a=this.selectedBrands.filter(function(a){return this.filteredProductsBrands.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedBrands.length!==a.length&&(this.selectedBrands=a),this.updateUrlParam()},onCategoriesFilterChange:function(){var a=this.selectedCategories.filter(function(a){return this.filteredProductsCategories.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedCategories.length!==a.length&&(this.selectedCategories=a),this.updateUrlParam()},onFeaturesFilterChange:function(){var a=this.selectedFeatures.filter(function(a){return this.filteredProductsFeatures.findIndex(function(b){return b.TitleSlug===a})>=0}.bind(this));this.selectedFeatures.length!==a.length&&(this.selectedFeatures=a),this.updateUrlParam()},initProductGrid:function(){this.productGrid=this.products.map(function(a){return this.componentKey++,{type:"product",productTile:{cta:{bgColor:g.ColorPrimary?g.ColorPrimary:"#CB333B",url:a.BuyNowLink?a.BuyNowLink:"",urlLabel:a.BuyNowLink?g.ProductButtonLabel:g.ProductCTALabel,urlTarget:a.BuyNowLink?"_blank":"_self",isUrlAbsolute:!!a.BuyNowLink},inventory:{stockCountLabel:g.InventoryCountLabel,checkStockCountLabel:g.CheckAvailabilityLabel,checkOtherStockCountlabel:g.CheckOtherStoresLabel},product:{id:a.Upc,image:{alt:a.Title+".",url:a.Images&&a.Images.length>0?a.Images[0].LowRes:""},link:{url:a.BuyNowLink?a.BuyNowLink:"",target:"_blank",isAbsolute:!0},tags:a.Tags,title:a.Title,offer:a.OfferShortText,pwr:{id:"pw-snippet-"+a.UpcDisplay,apiKey:g.PwrApiKey,merchantId:g.PwrMerchantId,merchantGroupId:g.PwrMerchantGroupId,locale:g.PwrLocale},upc:a.UpcDisplay}}}},this)},onResize:function(){this.screenWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),this.screenWidth>640&&(this.isFiltersActive=!1,this.isFiltersMobile=!1,TweenLite.to(".module-product-listing-with-feature-filter__features-fieldset-container",.4,{height:0}),this.isFeatureFilterActive=!1)},showHideFeatureFilter:function(){this.isFeatureFilterActive?(TweenLite.to(".module-product-listing-with-feature-filter__features-fieldset-container",.4,{height:0}),this.isFeatureFilterActive=!1):(TweenLite.set(".module-product-listing-with-feature-filter__features-fieldset-container",{height:"auto"}),TweenLite.from(".module-product-listing-with-feature-filter__features-fieldset-container",.4,{height:0}),this.isFeatureFilterActive=!0)},showHideFilter:function(){this.isFiltersActive?(TweenLite.to(".module-product-listing-with-feature-filter__filters-container",.3,{height:0}),this.isFiltersActive=!1):(TweenLite.set(".module-product-listing-with-feature-filter__filters-container",{height:"auto"}),TweenLite.from(".module-product-listing-with-feature-filter__filters-container",.3,{height:0}),this.isFiltersActive=!0)},loadMoreProducts:function(){h.scrollTo$ElementAsync($(this.$refs.loadMoreButton),500),this.currentPageNumber=this.currentPageNumber+1,this.getProducts()},initFilters:function(a){a&&(a.categoryFilters&&(this.filteredProductsCategories=a.categoryFilters.map(function(a){return{Count:a.Count,Title:a.Name,TitleSlug:a.Key}})),a.brandFilters&&(this.filteredProductsBrands=a.brandFilters.map(function(a){return{Count:a.Count,Title:a.Name,TitleSlug:a.Key}})),a.featureFilters&&(this.filteredProductsFeatures=a.featureFilters.map(function(a){return{Count:a.Count,IconUrl:a.IconUrl,Title:a.Name,TitleSlug:a.Key}})))},updateUrlParam:function(){var a={};this.selectedCategories.length>0&&(a=Object.assign({},a,{categories:this.selectedCategories.join(",")})),this.selectedBrands.length>0&&(a=Object.assign({},a,{brands:this.selectedBrands.join(",")})),this.selectedFeatures.length>0&&(a=Object.assign({},a,{features:this.selectedFeatures.join(",")})),this.currentPageNumber=0,h.setUrlVars(a),this.getUrlVars(),this.getProducts()},hideFilters:function(){this.isFiltersActive=!1},clearFilters:function(){this.selectedBrands=[],this.selectedCategories=[],this.selectedFeatures=[],this.updateUrlParam()}}),computed:Object.assign({},Vuex.mapState("storeSelector",["inventories","popUp","selectedStore"]),{inventory:function(){return{stockCountLabel:g.InventoryCountLabel,checkStockCountLabel:g.CheckAvailabilityLabel,checkOtherStockCountlabel:g.CheckOtherStoresLabel}},totalPageNumber:function(){return Math.ceil(this.totalProductCount/g.ProductsPerPage)-1}})})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Data.ArticleAndVideoBadgeGrid"),f=b.resolve("SDM.Util");c.ArticleAndVideoBadgeGrid=function(a){new Vue({el:a[0],components:{"pop-up":d.PopUp},props:{},data:function(){return{articlesData:[],articlesGrid:[],componentKey:0,currentPage:0,selectedFilters:[],totalPages:0,videoId:"",videoTitle:""}},created:function(){this.articlesData=JSON.parse(e.TilesData),this.initArticlesGrid()},mounted:function(){this.showVideoModal(),this.$root.$on("pop-up-closed",function(){f.setUrlVars()}),this.initAnim()},methods:{initAnim:function(){TweenMax.set(".module-article-and-video-badge-grid__article",{opacity:0}),setTimeout(function(){TweenMax.staggerTo(".module-article-and-video-badge-grid__article",.4,{opacity:1},.1)},200)},initArticlesGrid:function(){var a;a=this.selectedFilters.length>0?this.articlesData.filter(function(a){return this.selectedFilters.findIndex(function(b){return a.Type===b})>=0}.bind(this)):this.articlesData,this.totalPages=(a.length-e.InitialLoadTileCount)/e.LoadMoreTileCount;var b;b=0===this.currentPage?a.slice(0,e.InitialLoadTileCount):a.slice(0,Number(e.InitialLoadTileCount)+Number(this.currentPage*e.LoadMoreTileCount)),this.articlesGrid=b.map(function(a){return{type:a.Type,description:a.Description,image:{altText:a.Image.Label,url:a.Image.URL},legalText:a.LegalText,tag:a.Tag,title:a.Title,timeToRead:a.TimeToRead,cta:{label:a.URLLabel,slug:a.FriendlyUrlName,target:a.Target,url:a.URL}}},this)},setVideoParam:function(a){f.setUrlVars({v:a}),this.showVideoModal()},showVideoModal:function(){if(f.getUrlVars().v){var a=this.articlesData.filter(function(a){if(a.FriendlyUrlName===f.getUrlVars().v)return a}.bind(this));this.videoTitle=a[0].Title,this.videoId=a[0].URL,this.$refs.articleVideoModal.showPopUp()}},onFiltersChange:function(){this.currentPage=0,this.initArticlesGrid(),this.initAnim()},onLoadMore:function(){f.scrollTo$ElementAsync($(this.$refs.loadMoreButton),500,100),this.currentPage++,this.initArticlesGrid()}}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Util");c.RichTextAreaGeo=function(a){var c=b.resolve("SDM.Vue.Vuex");c.hasModule("provinceSelector")||c.registerModule("provinceSelector",d.ProvinceSelector),new Vue({el:a[0],created:function(){},computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{}),data:function(){return{sdmLocationProvinceId:""}},methods:{},mounted:function(){var a=JSON.parse(e.getValueFromCookie("sdm-location"));this.sdmLocationProvinceId=a&&a.province?a.province:""},store:c,watch:{}})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Widgets"),f=0;c.VideoProductCarousel=function(a){var c=a.data("contentId"),g=b.resolve("SDM.Data.VideoProductCarousel")[c],h=b.resolve("SDM.Vue.Vuex");h.hasModule("storeSelector")||h.registerModule("storeSelector",d.StoreSelector),new Vue({el:a[0],store:h,components:{"product-carousel":e.ProductCarousel,"store-selector-modal":e.StoreSelectorModal},data:function(){return{modifiedProducts:[],products:[],reviewArray:[],showInventory:!1,categoryCarouselsSlidesToShow:{desktop:3,tablet:1,mobile:1},breakpoints:{tablet:960}}},beforeMount:function(){this.products=g.Products,this.showInventory="False"===g.HideInventory,this.initModifiedProducts()},mounted:function(){this.setInventories(g.Inventory.Stores);var a=this;setTimeout(function(){a.initPowerReviewsRatings(a.modifiedProducts)},f),f+=500},methods:Object.assign({},Vuex.mapActions("storeSelector",{setInventories:"setInventories"}),{initModifiedProducts:function(){this.modifiedProducts=this.products.map(function(a){var b={};return this.showInventory&&(b={stockCountLabel:g.InStoreLabel,checkStockCountLabel:g.CheckAvailabilityLabel,checkOtherStockCountlabel:g.CheckOtherStoresLabel}),{id:a.UpcStripped,text1:a.Title.split(" ").length>8?a.Title.split(" ").slice(0,6).join(" ")+"...":a.Title,image:{url:a.ImageUrl,alt:a.Title+" image"},link:a.ProductCTA,cta:{url:a.ProductCTA,label:g.ShopLabel,isAbsolute:!!a.ProductCTA},pwr:{id:a.UpcStripped?c+"-video-product-carousel-pwr-snippet--"+a.UpcStripped:null},upc:a.UpcStripped,inventory:b}},this)},initPowerReviewsRatings:function(a){for(var b=[],c=0;a.length>c;c++)null!==a[c].pwr&&b.push({api_key:g.PowerReviewsApiKey,locale:g.PowerReviewsLocale,merchant_group_id:g.PowerReviewsMerchantGroupId,merchant_id:g.PowerReviewsMerchantId,page_id:a[c].upc,components:{CategorySnippet:a[c].pwr.id}});pwr("render",b)}})})}}(this),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Vue.Modules"),d=b.resolve("SDM.Vue.Stores"),e=b.resolve("SDM.Vue.Widgets");c.ProvinceSelector=function(a){var c=b.resolve("SDM.Vue.Vuex");c.hasModule("provinceSelector")||c.registerModule("provinceSelector",d.ProvinceSelector),new Vue({components:{"province-selector":e.ProvinceSelector},computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{}),data:function(){return{}},el:a[0],methods:{},mounted:function(){},store:c})}}(this),function(a){"use strict";var b=a.jQuery,c=a.NR,d=c.resolve("SDM.Vue.Modules"),e=c.resolve("SDM.Vue.Stores"),f=c.resolve("SDM.Vue.Mixins"),g=c.resolve("SDM.Util");d.TextBadgeGrid=function(a){var d=a.data("contentId"),h=c.resolve("SDM.Data.TextBadgeGrid")[d],i=c.resolve("SDM.Vue.Vuex");i.hasModule("provinceSelector")||i.registerModule("provinceSelector",e.ProvinceSelector),new Vue({computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{badges:function(){return h.Badges.filter(function(a){return a.provinces.includes(this.userProvinceId)}.bind(this))},numColumns:function(){return this.isDesktopLarge?4:this.isDesktop?2:1}}),data:function(){return{buttonFilters:h.ButtonFilters,cta1Height:[],selectedFilter:"",headingHeight:[],noteHeight:[],textHeight:[],text2Height:[]}},el:a[0],methods:{getHeadingHeight:function(a){var b=this.headingHeight[Math.floor(a/this.numColumns)];return b||0},getTextHeight:function(a){var b=this.textHeight[Math.floor(a/this.numColumns)];return b||0},getText2Height:function(a){var b=this.text2Height[Math.floor(a/this.numColumns)];return b||0},getNoteHeight:function(a){var b=this.noteHeight[Math.floor(a/this.numColumns)];return b||0},getCta1Height:function(a){var b=this.cta1Height[Math.floor(a/this.numColumns)];return b||0},getMaxHeadingHeight:function(){var a=Array.from(this.$el.querySelectorAll(".module-text-badge-grid__badge__heading")||[]);this.headingHeight=[];for(var b=0,c=a.length;b .wg-acc-content").slideToggle()},methods:{getYouTubeID:function(a){var b=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/,c=a.match(b);return!(!c||11!==c[7].length)&&c[7]},getVimeoID:function(a){var b=/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,c=a.match(b);return!(!c||!c[2])&&c[2]},toggleAccordion:function(a){c(a.target).parent().toggleClass("wg-acc-active"),c(a.target).next().slideToggle()},toggleAccordionIcon:function(a){c(a.target).parent().parent().toggleClass("wg-acc-active"),c(a.target).parent().next().slideToggle()}},store:d})}}(this),function(a){"use strict";a.NR.resolve("SDM.Vue.Modules").GlobalPromotionGrid=function(a){new Vue({data:function(){return{seenBadges:[]}},el:a[0],methods:{badgeClick:function(a){window.location.href.includes("home")&&dataLayer.push({event:"badge_click","badge.id":a.currentTarget.getAttribute("data-id"),"badge.position":a.currentTarget.getAttribute("data-index"),"badge.name":a.currentTarget.getAttribute("data-name"),"badge.image_url":a.currentTarget.querySelectorAll(".md-gpg__badge-image")[0].src})},isElementInView:function(a){var b=a.getBoundingClientRect(),c=b.top,d=b.top+b.height;return c>=0&&d<=Math.min(document.documentElement.clientHeight,window.innerHeight||0)},checkElementViewability:function(){for(var a=document.querySelectorAll(".md-gpg__badge"),b=0;b
  • <%= condition.name %>
  • <% }); %>",alphabetLink:"<%= alphabet %>"},defaultListItemLimit:0,urls:{conditionListJson:"/<%- shortLanguageCode %>/condition/getConditionsByLetter?letter=<%- alphabet %>",conditionDetailPage:"/<%- shortLanguageCode %>/health-and-pharmacy/conditions/<%= name %>/<%- id %>",conditionPage:"/<%- shortLanguageCode %>/health-and-pharmacy/conditions/<%- alphabet %>"}};this.config=d.extend(!0,c,b||{}),this._initialize(a)};a.prototype.getConditionObject=function(a,b,e){var f=this._getJsonUrl(b),g=this,h=function(b){return b=c(b).filter(function(a){return a.DiseaseName&&a.DiseaseId}),a>0&&(b=b.slice(0,a)),c(b).map(function(a){return{name:a.DiseaseName,link:g._getConditionDetailPageLink(a.SafeDiseaseName,a.DiseaseId)}})};return d.ajax({dataType:"json",url:f,beforeSend:e}).pipe(h)},a.prototype._getJsonUrl=function(a){return this.urls.conditionListJson({alphabet:encodeURIComponent(a),shortLanguageCode:f.getShortLanguageCode()})},a.prototype._getConditionDetailPageLink=function(a,b){return this.urls.conditionDetailPage({name:encodeURIComponent(a).toLowerCase(),id:encodeURIComponent(b),shortLanguageCode:f.getShortLanguageCode()})},a.prototype.getConditionPageLink=function(a){return this.urls.conditionPage({alphabet:encodeURIComponent(a).toLowerCase(),shortLanguageCode:f.getShortLanguageCode()})},h.prototype._initialize=function(b){var d=this.config.dataLabels,e=this.config.templates,f=b,g=f.find("["+d.listTemplate+"]"),h=g.length>0?g.html():e.list,i=f.find("["+d.alphabetLinkTemplate+"]"),j=i.length>0?i.html():e.alphabetLink,k=c.bind(this._onClickAlphabetButton,this);this.listTemplate=c.template(h),this.$listContainer=f.find("["+d.listContainer+"]"),this.alphabetLinkTemplate=c.template(j),this.$alphabetLinkContainer=f.find("["+d.alphabetLinkContainer+"]"),this.listItemLimit=f.attr(d.listItemLimit)||this.config.defaultListItemLimit,this.$loadingContainer=f.find("["+d.loadingContainer+"]"),this.$errorContainer=f.find("["+d.errorContainer+"]"),this.activeAlphabetContainer=f.find("["+d.activeAlphabetContainer+"]"),this.alphabetButtonAttributeName=d.alphabetButton,this.$alphabetButtons=f.find("["+d.alphabetButton+"]"),this.defaultAlphabet=f.attr(d.defaultAlphabet)||null,this.$noItemsContainer=f.find("["+d.noItemsContainer+"]"),this.onChangeEventHandler=function(){}, this.previousAjaxRequestXhr=null,this.previousAlphabet=null,this.gateway=new a(this.config),this._deleteListItems(),this._deleteAlphabetLink(),this._hideLoading(),this._hideError(),this.$alphabetButtons.on("click.sdm-condition-widget",k),this.defaultAlphabet&&this.render(this.defaultAlphabet)},h.prototype._onClickAlphabetButton=function(a){var b=d(a.currentTarget),c=b.attr(this.alphabetButtonAttributeName);this.render(c)},h.prototype._activateButton=function(a){this.$alphabetButtons.removeClass(this.config.class_names.active),a.addClass(this.config.class_names.active)},h.prototype._renderAlphabetCharacter=function(a){this.activeAlphabetContainer.text(a)},h.prototype._renderAlphabetLink=function(a){this.$alphabetLinkContainer.html(this.alphabetLinkTemplate(a))},h.prototype._deleteAlphabetLink=function(){this.$alphabetLinkContainer.empty()},h.prototype._renderListItems=function(a){this.$listContainer.html(this.listTemplate({conditions:a}))},h.prototype._deleteListItems=function(){this.$listContainer.empty()},h.prototype._showLoading=function(){this.$loadingContainer.show()},h.prototype._hideLoading=function(){this.$loadingContainer.hide()},h.prototype._showError=function(){this.$errorContainer.show()},h.prototype._hideError=function(){this.$errorContainer.hide()},h.prototype._showNoItems=function(){this.$noItemsContainer.show()},h.prototype._hideNoItems=function(){this.$noItemsContainer.hide()},h.prototype.render=function(a){var b=this.$alphabetButtons.filter("["+this.alphabetButtonAttributeName+"='"+a+"']"),d=this.previousAlphabet&&this.previousAlphabet!==a,e=null===this.previousAlphabet,f=c.bind(function(a){a.length>0?this._renderListItems(a):this._showNoItems(),this._hideLoading()},this),g=c.bind(function(){this._showError(),this._hideLoading(),this.previousAlphabet=null},this),h={alphabet:a,link:this.gateway.getConditionPageLink(a)},i=c.bind(function(a){this.previousAjaxRequestXhr=a},this);(e||d)&&(d&&this.onChangeEventHandler(a),this.previousAjaxRequestXhr&&this.previousAjaxRequestXhr.abort(),this._activateButton(b),this._showLoading(),this._deleteListItems(),this._hideError(),this._hideNoItems(),this._renderAlphabetCharacter(a),this._renderAlphabetLink(h),this.previousAlphabet=a,this.gateway.getConditionObject(this.listItemLimit,a,i).done(f).fail(g))},h.prototype.setOnChangeEventHandler=function(a){this.onChangeEventHandler=a}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d="<%= title %> <%= views %> views <%= age %> ago",e=a.NR||(a.NR={}),f=e.resolve("SDM.Core.Widgets"),g=e.resolve("SDM.Util"),h=f.FeaturedVideo=function(a,b){var d={data_labels:{video_placeholder:"data-fvd-video-placeholder",video_info_template:"data-fvd-video-info-template",video_info_container:"data-fvd-video-info-container",loading_container:"data-fvd-loading-container",error_container:"data-fvd-error-container",youtube_api_key:"AIzaSyAqyipvzq62aB7-5OZ35FiVAp4T2WszDTM",youtube_video:"data-fvd-youtube-id",vimeo_video:"data-fvd-vimeo-id"},video_info_template:""};this.config=c.extend(!0,d,b||{}),this._initialize(a)},i=h.YoutubeVideo=function(a,b,d){var e={url_regex:/youtube\.com\/watch\?(.*)([^&]&)?v=([^\s&#]+)/};this.config=c.extend(!0,e,d||{}),this._setInstanceVars(b,a),this._initialize()};i.prototype._setInstanceVars=function(a,b){var c=a.match(this.config.url_regex);this.video_id=c&&c[3]?c[3]:null;var d=this.config.data_labels;this.$container=b,this.$video_placeholder=b.find("["+d.video_placeholder+"]"),this.$video_info_container=b.find("["+d.video_info_container+"]"),this.$loading_container=b.find("["+d.loading_container+"]"),this.$error_container=b.find("["+d.error_container+"]"),this.video_info_template=this.config.video_info_template},i.prototype._initialize=function(){if(this.$loading_container.hide(),this.$error_container.hide(),this.$video_info_container.hide(),!this.video_id)return this.$loading_container.hide(),this.$error_container.show(),void this.$video_info_container.hide();this._loadVideo(),this._loadData()},i.prototype._loadVideo=function(){g.loadYoutubeVideoApi().done(b(this._createPlayerInstance).bind(this))},i.prototype._createPlayerInstance=function(){var a=this.$video_placeholder.attr("id",this.video_id).attr("id"),b=this.$video_placeholder.attr("width"),c=this.$video_placeholder.attr("height");return new YT.Player(a,{width:b,height:c,videoId:this.video_id,playerVars:{controls:1,showinfo:0,modestbranding:1,wmode:"opaque"}})},i.prototype._loadData=function(){var a=this.config.youtube_api_key,c="https://www.googleapis.com/youtube/v3/videos?id="+this.video_id+"&key="+a+"&part=snippet,statistics";this.$loading_container.show(),this.$error_container.hide(),this.$video_info_container.hide();var d=b(this._renderVideoInfo).bind(this),e={dataType:"json"};SDM.Util.ajax(c,e).done(d).fail(b(function(){this.$error_container.show(),this.$loading_container.hide()}).bind(this))},i.prototype._renderVideoInfo=function(a){var b=this._parseVideoInfo(a);this.$video_info_container.html(this.video_info_template(b)).show(),this.$loading_container.hide()},i.prototype._parseVideoInfo=function(a){if(!(a&&a.items&&a.items.length))return{};var b=a.items[0];return{title:b.snippet.title,link:"https://www.youtube.com/watch?v="+b.id,views:parseInt(b.statistics.viewCount,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),age:this._getAge(b.snippet.publishedAt)}},i.prototype._getAge=function(a){var b=new Date,c=new Date(Date.parse(a)),d={};return d.diffYears=b.getUTCFullYear()-c.getUTCFullYear(),d.diffMonths=b.getUTCMonth()-c.getUTCMonth()+12*d.diffYears,d};var j=h.VimeoVideo=function(a,b,d){var e={};this.config=c.extend(!0,e,d||{}),this._setInstanceVars(b,a),this._initialize()};j.prototype._setInstanceVars=function(a,b){this.video_id=a;var c=this.config.data_labels;this.$video_info_container=b.find("["+c.video_info_container+"]"),this.$loading_container=b.find("["+c.loading_container+"]"),this.$error_container=b.find("["+c.error_container+"]"),this.video_info_template=this.config.video_info_template},j.prototype._initialize=function(){if(this.$loading_container.hide(),this.$error_container.hide(),this.$video_info_container.hide(),!this.video_id)return this.$loading_container.hide(),this.$error_container.show(),void this.$video_info_container.hide();this._loadData()},j.prototype._loadData=function(){this.$loading_container.show(),this.$error_container.hide(),this.$video_info_container.hide();var a="https://vimeo.com/api/v2/video/"+this.video_id+".json",c=b(this._renderVideoInfo).bind(this),d={data:{},dataType:"json"};SDM.Util.ajax(a,d).done(c).fail(b(function(){this.$error_container.show(),this.$loading_container.hide()}).bind(this))},j.prototype._renderVideoInfo=function(a){if(a.length>0){var b=this._parseVideoInfo(a[0]);this.$video_info_container.html(this.video_info_template(b)).show(),this.$loading_container.hide()}},j.prototype._parseVideoInfo=function(a){return{title:a.title,link:a.url,views:a.stats_number_of_plays,age:this._getAge(a.upload_date)}},j.prototype._getAge=function(a){var b=new Date,c=new Date(Date.parse(a)),d={};return d.diffYears=b.getUTCFullYear()-c.getUTCFullYear(),d.diffMonths=b.getUTCMonth()-c.getUTCMonth()+12*d.diffYears,d},h.prototype._initialize=function(a){this.config.video_info_template=this._getVideoInfoTemplate();var b=a,c=b.attr(this.config.data_labels.youtube_video),d=b.attr(this.config.data_labels.vimeo_video);c?new i(b,c,this.config):d&&new j(b,d,this.config)},h.prototype._getVideoInfoTemplate=function(){var a=c("["+this.config.data_labels.video_info_template+"]"),e=a.length>0?a.html():d;return b(e).template()}}.call(this),function(){function a(a,b){this._config=b,this._$widget=a,this._initialize()}function b(a,b,c){this._config=c,this._$star=a,this._index=b}var c=this,d=c._,e=c.jQuery,f="sdm-product-rating",g=c.NR||(c.NR={}),h=g.resolve("SDM.Core.Widgets");b.prototype.empty=function(){this._$star.addClass(this._config.classNames.emptyStar).removeClass(this._config.classNames.filledStar)},b.prototype.fill=function(){this._$star.removeClass(this._config.classNames.emptyStar).addClass(this._config.classNames.filledStar)},b.prototype.getIndex=function(){return this._index},b.prototype.setOnMouseEnterEventHandler=function(a){this._$star.on("mouseenter."+f,d(function(){a(this)}).bind(this))},b.prototype.setOnMouseLeaveEventHandler=function(a){this._$star.on("mouseleave."+f,d(function(){a(this)}).bind(this))},b.prototype.setOnClickEventHandler=function(a){this._$star.on("click."+f,d(function(){a(this)}).bind(this))},a.prototype._initialize=function(){this._stars=d(this._$widget.find("["+this._config.dataLabels.star+"]")).map(d(function(a,c){var f=new b(e(a),c,this._config);return f.setOnMouseEnterEventHandler(d(this._onMouseEnterStarEventHandler).bind(this)),f.setOnMouseLeaveEventHandler(d(this._onMouseLeaveStarEventHandler).bind(this)),f.setOnClickEventHandler(d(this._onClickStarEventHandler).bind(this)),f}).bind(this)),this._rate=parseInt(this._$widget.attr(this._config.dataLabels.rate)||0,10),this.updateStar()},a.prototype._onMouseEnterStarEventHandler=function(a){this._renderStar(a.getIndex())},a.prototype._onMouseLeaveStarEventHandler=function(){this.updateStar()},a.prototype._onClickStarEventHandler=function(a){this.setRate(a.getIndex()+1)},a.prototype._renderStar=function(a){d(this._stars).each(function(b){b.getIndex()<=a?b.fill():b.empty()})},a.prototype.updateStar=function(){this._renderStar(this._rate-1)},a.prototype.setRate=function(a){this._rate=a,this.updateStar()},a.prototype.getRate=function(){return this._rate},h.ProductRating=function(b,c){var d={dataLabels:{star:"data-prt-star",rate:"data-prt-rate"},classNames:{emptyStar:"mod-icn-gray-star",filledStar:"mod-icn-red-star"}};return new a(b,e.extend(!0,d,c||{}))}}.call(this),function(){var a=this,b=this._,c=a.jQuery,d=a.Accordion,e=a.NR,f=e.resolve("SDM.Core.Components"),g=e.resolve("SDM.Core.Widgets"),h=f.PopUp;FAQModal=g.FAQModal=function(a,b){var d={selectors:{fap_popup:"[data-wg-faq-popup]",faq_content:"[data-wg-faq-content]",faq_nano:"[data-wg-faq-nano]",faq_nano_content:"[data-wg-faq-nano-content]",parent_accordion:"[data-wg-faq-parent-accordion]",parent_accordion_button:"[data-wg-faq-parent-accordion-button]",parent_accordion_content:"[data-wg-faq-parent-accordion-content]",accordion:"[data-wg-faq-accordion]",accordion_button:"[data-wg-faq-accordion-button]",accordion_content:"[data-wg-faq-accordion-content]",flag:"[data-wg-faq-flag]",faq_list:"[data-wg-faq-list]",question_list:"[data-wg-faql-question-list]",question_list_item:"[data-wg-faql-question-list-item]"},classnames:{accordion_active_class:"wg-acc-active",parent_accordion_actice_class:"wg-parent-acc--active"},attributes:{list_item_id:"data-wg-faql-question-list-item",flag:"data-wg-faq-flag"},data_attributes:{initial_active_id:"wg-faq-initial-active-id",list_item_id:"wg-faql__question-list-item"}};this.config=c.extend(!0,d,b||{}),this._initialize(a)},FAQModal.prototype._initialize=function(a){this.$link=a,this.$link.on("click",b.bind(function(a){this.linkToFlag=c(a.currentTarget).attr(this.config.attributes.flag),a.preventDefault(),this._openPopup()},this)),this.popup=new h({templates:{modal:'
    '}}),this.template=b.template(c(this.config.selectors.faq_content).html()),this.initial_active_id=this.$link.data(this.config.data_attributes.initial_active_id)||null,this.$faqPopup=null,this.$nano=null,this.$nanoContent=null,this.nanoContentClass=null,this.linkToFlag=null,this.isClosed=!0,SDM.Util.isWindowWide()?this.popupHeightOffset=40:this.popupHeightOffset=0,this.popup.onOpenCompleted(b(this._onPopupOpened).bind(this)),this.popup.onCloseCompleted(b(this._onPopupClosed).bind(this)),this.popup.onRepositioned(b(this._onPopupRepositioned).bind(this))},FAQModal.prototype._initializeNanoScroller=function(a){var c={contentClass:this.nanoContentClass,preventPageScrolling:!0,alwaysVisible:!0};b(a).isNumber()&&(c.scrollTop=a),this.$nano.nanoScroller(c)},FAQModal.prototype._onPopupOpened=function(a){var e;if(new Analytics.DataAttributes,this.isClosed){this.$faqPopup.outerWidth(this.popup.$modal.css("width")),this.$nanoContent.css("position","");var f=null,g=0;b(c(a.currentTarget).find(this.config.selectors.parent_accordion)).each(b(function(a){var e=new d(c(a),{selectors:{button:this.config.selectors.parent_accordion_button,content:this.config.selectors.parent_accordion_content},classnames:{active:this.config.classnames.parent_accordion_actice_class}});e.id=g++,e.isActive()&&(e.open(0),f=e),e.onClickButton(b(function(){f&&f.id!==e.id&&f.close()}).bind(this)),e.onOpenCompleted(b(function(){f=e,this._initializeNanoScroller(),c(this.$nano.find(this.config.selectors.faq_nano_content)).stop().animate({scrollTop:f.$element.get(0).offsetTop-15},300)}).bind(this)),e.onCloseCompleted(b(function(){this._initializeNanoScroller(),f&&f.id===e.id&&(f=null)}).bind(this))}).bind(this)),b(c(a.currentTarget).find(this.config.selectors.accordion)).each(b(function(a){var e=c(a),f=new d(e,{selectors:{button:this.config.selectors.accordion_button,content:this.config.selectors.accordion_content}});f.isActive()&&(f.open(0),c(this.$nano.find(this.config.selectors.faq_nano_content)).stop().animate({scrollTop:e.get(0).offsetTop-15},300)),f.onOpenCompleted(b(function(){this._initializeNanoScroller()}).bind(this)),f.onCloseCompleted(b(function(){this._initializeNanoScroller()}).bind(this))}).bind(this)),this.linkToFlag?(e=this._findFlag(this.linkToFlag),0!==e.length?this._initializeNanoScroller(e.position().top):this._initializeNanoScroller()):this._initializeNanoScroller(),this.isClosed=!1}},FAQModal.prototype._findFlag=function(a){return this.$nanoContent.find(this.config.selectors.flag).filter("["+this.config.attributes.flag+"='"+a+"']")},FAQModal.prototype._onPopupClosed=function(){this.isClosed=!0},FAQModal.prototype._onPopupRepositioned=function(){this.popup.$modal&&(this.$faqPopup.outerWidth(this.popup.$modal.width()),this._initializeNanoScroller())},FAQModal.prototype._openPopup=function(){var a,b=this.template(),d=c(b);this.$faqPopup=d.is(this.config.selectors.fap_popup)?d:d.find(this.config.selectors.fap_popup),this.$nano=d.find(this.config.selectors.faq_nano),this.$nanoContent=d.find(this.config.selectors.faq_nano_content),this.nanoContentClass=this.$nanoContent.attr("class"),a=this.linkToFlag?this._findFlag(this.linkToFlag):c({}),this.initial_active_id?d.find("["+this.config.attributes.list_item_id+'="'+this.initial_active_id+'"]:first').find(this.config.selectors.accordion).addClass(this.config.classnames.accordion_active_class).parents(this.config.selectors.parent_accordion).addClass(this.config.classnames.parent_accordion_actice_class):a.length?a.addClass(this.config.classnames.parent_accordion_actice_class):d.find(this.config.selectors.question_list_item+":first").parents(this.config.selectors.parent_accordion).addClass(this.config.classnames.parent_accordion_actice_class),this.$nanoContent.css("position","static"),this.$faqPopup.css("height",c(window).height()-this.popupHeightOffset),this.popup.open(d[0])},FAQModal.prototype.get$link=function(){return this.$link}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.Backbone,e="gpalwf-events",f=a.NR||(a.NR={}),g=f.resolve("SDM.Core.Components"),h=f.resolve("SDM.Core.Widgets"),i=g.CollapsibleButtonList,j=g.ArticleSummaryCollection,k=g.ArticleSummaryListingView,l=null,m=h.GeneralArticleSummaryListing=function(a,b){var d={selectors:{listingContainer:"[data-wg-gasl-listing-container]",filterContainer:"[data-wg-gasl-filter-container]",pageTitle:"[data-wg-gasl-title]",filterButton:"[data-wg-gasl-filter-button]",defaultButton:"[data-wg-gasl-filter-button-default]"},attributes:{tag:"data-wg-gasl-article-tag",detailPageUrlRoot:"data-wg-gasl-detail-page-url-root",jsonResourceUrlRoot:"data-wg-gasl-json-resource-url-root",filterRouterUrlRoot:"data-wg-gasl-filter-router-url-root",filterId:"data-wg-gasl-filter-id",filterPageTitle:"data-wg-gasl-filter-title",filterName:"data-wg-gasl-filter-name",truncateLimit:"data-wg-gasl-truncate-limit",destinationID:"data-wg-gasl-destinationID",tagID:"data-wg-gasl-tagID",articleIDs:"data-wg-gasl-articleIDs"}};this.config=c.extend(!0,d,b||{}),this._initialize(a)};m.prototype._initialize=function(a){this.tag=a.attr(this.config.attributes.tag)||"",this.destinationID=a.attr(this.config.attributes.destinationID)||"",this.tagID=a.attr(this.config.attributes.tagID)||"",this.articleIDs=a.attr(this.config.attributes.articleIDs)||"",this.truncateLimit=a.attr(this.config.attributes.truncateLimit)||"0",this.detailPageUrlRoot=a.attr(this.config.attributes.detailPageUrlRoot),this.jsonResourceUrlRoot=a.attr(this.config.attributes.jsonResourceUrlRoot),this.filterRouterUrlRoot=this._cleanUpUrL(a.attr(this.config.attributes.filterRouterUrlRoot)||""),this.$listingContainer=a.find(this.config.selectors.listingContainer),this.$filterContainer=a.find(this.config.selectors.filterContainer),this.$pageTitle=a.find(this.config.selectors.pageTitle),this.router=null,this._setupListing(),this.$filterContainer.length>0&&this.filterRouterUrlRoot?(this.$filterButtons=a.find(this.config.selectors.filterButton),this.collapsibleButtonList=new i({$container:this.$filterContainer}),this.$filterButtons.on("click."+e,b(this._onClickFilterLink).bind(this)),this.router=new l({urlRoot:this.filterRouterUrlRoot}),this.router.on("route-home",b(function(){this.$filterButtons.filter(this.config.selectors.defaultButton).trigger("click."+e,{isPreventNavigation:!0})}).bind(this)),this.router.on("route-filter",b(function(a,b){this.$filterButtons.filter("["+this.config.attributes.filterId+"='"+b+"']").trigger("click."+e,{isPreventNavigation:!0})}).bind(this)),this.router.start()):this.articleSummaryCollection.setCurrentPage(1).setCategoryId().fetch()},m.prototype._setupListing=function(){this.articleSummaryCollection=new j,this.articleSummaryListingView=new k({$container:this.$listingContainer,collection:this.articleSummaryCollection}),this.articleSummaryCollection.setTag(this.tag).setDestinationID(this.destinationID).setTagID(this.tagID).setArticleIDs(this.articleIDs).setDetailPageUrlRoot(this.detailPageUrlRoot).setTruncateLimit(this.truncateLimit).setJsonResourceUrlRoot(this.jsonResourceUrlRoot)},m.prototype._onClickFilterLink=function(a,d){d=d||{};var e=c(a.currentTarget),f=e.attr(this.config.attributes.filterId),g=e.attr(this.config.attributes.filterPageTitle),h=(e.attr(this.config.attributes.filterName)||"").toLowerCase(),i=e.is(this.config.selectors.defaultButton);if(this.articleSummaryListingView.showLoading(),this.articleSummaryListingView.clearResults(),this.articleSummaryCollection.setCurrentPage(1).setCategoryId(f).fetch(),b.each(this.collapsibleButtonList.getItems(),function(a){a.getName()===f?a.addActiveClass():a.removeActiveClass()}),this.$pageTitle.length>0&&this.$pageTitle.html(g),a.preventDefault(),d.isPreventNavigation)return void this.articleSummaryListingView.clearResults();i?this.router.navigate(""):this.router.navigate(h+"/"+f)},m.prototype._cleanUpUrL=function(a){if(""===a)return"";var b=a.match(/^(http[s]?:\/\/[^\/]+)?(\/.*)$/);return b&&b.length>=3&&b[2]?b[2]:null},l=d.Router.extend({initialize:function(a){this.urlRoot=a.urlRoot,this.route("","home"),this.route(/^([A-Za-z0-9_\-]+)\/(\d+)$/,"filter")},home:function(){this.trigger("route-home")},filter:function(a,b){this.trigger("route-filter",a,b)},start:function(){d.history.start({pushState:!0,root:this.urlRoot})}})}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.Backbone,e=d.SharedSimpleRouter.getInstance(),f=a.NR||(a.NR={}),g=f.resolve("SDM.Core.Widgets"),h=g.AnchorsInPage=function(a,b){var d={selectors:{container:"[data-widget-anchors-in-page]",anchor:"[data-wg-aip-anchor]"},attributes:{active_class_name:"data-wg-aip-active-class",default_route_id:"data-wg-aip-default-route-id"}};this.config=c.extend(!0,d,b||{}),this._initialize(a)};h.prototype._initialize=function(a){a=a.is(this.config.selectors.container)?a:a.find(this.config.selectors.container),0!==a.length&&(this.defaultRouteId=a.attr(this.config.attributes.default_route_id)||!1,this.activeClassName=a.attr(this.config.attributes.active_class_name),this.anchors=b(b(a.find(this.config.selectors.anchor)).map(b(function(a){var b=c(a);return[b.attr("href").replace("#",""),b]}).bind(this))).object(),this._setupRouter(),this._setupClickEvent())},h.prototype._setupRouter=function(){b(this.anchors).each(b(function(a,c){e.on(c,b(function(){this._addActiveClass(c)}).bind(this))}).bind(this)),!this.anchors[""]&&this.defaultRouteId&&e.on("",b(function(){this._addActiveClass(this.defaultRouteId)}).bind(this)),e.historyStart()},h.prototype._setupClickEvent=function(){b(this.anchors).each(b(function(a,c){a.on("click.anchors-in-page",b(function(a){e.navigate(c,{trigger:!0}),a.preventDefault()}).bind(this))}).bind(this))},h.prototype._addActiveClass=function(a){b(this.anchors).each(b(function(b,c){a===c?b.addClass(this.activeClassName):b.removeClass(this.activeClassName)}).bind(this))}}.call(this),function(a){"use strict";var b=a.jQuery,c=a.NR||(a.NR={}),d=c.resolve("SDM.Core.Widgets"),e=c.resolve("SDM.Util"),f=c.resolve("SDM.Core.Components.BrooklynAuth"),g=f.Repository;d.BrooklynLogin=function(a,c){c=c||{},b(".widget-brooklyn-login--okta").length>=1&&g.getOktaConfigurationAsync().done(_.bind(function(a){for(var d={okta:{i18n:{en:{},fr:{}},baseUrl:a.EnvironmentBaseUrl,pcidUrls:{pcidMigrationUrl:a.PcidMigrationUrl,passwordPolicyUrl:a.PasswordPolicyUrl},language:e.getShortLanguageCode(),assets:{baseUrl:"https://assets.lblw.cloud/okta-signin-widget"},helpLinks:{forgotPassword:"https://www.pcoptimum.ca/forgot-password",login:[{text:"",link:"ld.pcid.primary.auth.create.account",href:"https://www.pcoptimum.ca/register"}],mfa:[{text:"ld.pcid.primary.auth.need.help",link:"ld.pcid.primary.auth.contact.support",href:"https://loblaw.force.com/PCoptimumsupport/s/?language="+e.getShortLanguageCode()}]}}},f=0;f0,this.has_mobile_images=b.length>0,this.image_loader_promise=c.when.apply(this,[d,e]).promise()},onOpenPopUp:function(a){this.on("open-popup",a)},onClickContent:function(a){this.on("click-content",a)},onClosePopup:function(a){this.on("close-popup",a)},isAbleToShowPopup:function(){return(SDM.Util.isWindowWide()||SDM.Util.isWindowSmallDesktopWide()||SDM.Util.isWindowExtraWide())&&this.has_pc_images||!SDM.Util.isWindowWide()&&this.has_mobile_images},showPopUp:function(){this.image_loader_promise.done(b(function(){if(this.isAbleToShowPopup()){this.popup=new f,this.popup.open(this.el),a.Placeholder&&new Placeholder,this.trigger("open-popup"),this.popup.$modal.find(this.config.selectors.content).on("click."+h+"-"+this.cid,b(function(){this.trigger("click-popup")}).bind(this)),this.popup.onCloseCompleted(b(function(){this._unbindResizeEvents(),this.trigger("close-popup")}).bind(this));var c=this.$('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').first();c.length&&c.focus(),this.popup.$modal.on("keydown",function(a){var b="Tab"===a.key||9===a.keyCode,c=event.currentTarget;if(b){var d=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),e=d[0],f=d[d.length-1];a.shiftKey?document.activeElement===e&&(f.focus(),a.preventDefault()):document.activeElement===f&&(e.focus(),a.preventDefault())}}),this._bindResizeEvents()}}).bind(this))},_createImageLoaderPromise:function(a){var d=b(a).map(function(a){var b=c.Deferred(),d=new Image;return c(d).on("load",function(){b.resolve()}),d.src=a.src,b.promise()});return c.when.apply(this,d).promise()},_switchModeToPC:function(){this.popup&&!this.has_pc_images&&this.popup.close()},_switchModeToMobile:function(){this.popup&&!this.has_mobile_images&&this.popup.close()},_bindResizeEvents:function(){this.$window.on("becometowide."+h+"-"+this.cid,b(this._switchModeToPC).bind(this)),this.$window.on("becometonarrow."+h+"-"+this.cid,b(this._switchModeToMobile).bind(this))},_unbindResizeEvents:function(){this.$window.off("becometowide."+h+"-"+this.cid),this.$window.off("becometonarrow."+h+"-"+this.cid)}})}.call(this),function(a){var b=a.jQuery,c=a.NR||(a.NR={}),d=c.resolve("SDM.Core.Components"),e=c.resolve("SDM.Core.Widgets"),f=d.PopUp,g=e.PopUpBlogRedirect=function(a,c){c=c||{};var d={selectors:{redirect_image:"[data-pbr-redirect-image]"}};this.config=b.extend(!0,{},d,c),this.$el=a,this._init()};g.prototype._init=function(){this.popup=new f,this.popup_content=this.$el.html(),this.event_namespace="."+_.uniqueId("PopUpBlogRedirect_"),this.popup.onOpenCompleted(_.bind(this._bindEvents,this))},g.prototype.openPopUp=function(){this.popup.open(this.popup_content)},g.prototype.isViewable=function(){return!0},g.prototype._bindEvents=function(){this.popup.$modal.on("click"+this.event_namespace,this.config.selectors.redirect_image,_.bind(function(){this.popup.close()},this))}}(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Widgets"),f=d.resolve("SDM.Core.Components.EventHub"),g=e.PopUpManager=function(a,b){b=b||{};var d={selectors:{widget:"[data-popup-widget]"},data_attributes:{name:"popup-widget",priority:"popwg-priority"},names:{brooklyn_convert_popup:"brooklyn-convert-popup",pop_up_optimum_vib:"pop-up-optimum-vib",pop_up_welcome:"pop-up-welcome",pop_up_blog_redirect:"pop-up-blog-redirect"}};this.config=c.extend(!0,{},d,b),this._initialize(a)};g.prototype._initialize=function(){var a=c(this.config.selectors.widget),d=this.config.names;this.popups=[],this.boundUnshift=b.bind(this.unshift,this),this.boundEmpty=b.bind(this.empty,this),b.each(a,function(a){var b=c(a),f=b.data(this.config.data_attributes.name),g=b.data(this.config.data_attributes.priority);switch(f){case d.brooklyn_convert_popup:this.popups.push({widget:new e.BrooklynConvertPopup(b),priority:g});break;case d.pop_up_optimum_vib:this.popups.push({widget:new e.PopUpOptimumVib(b),priority:g});break;case d.pop_up_welcome:this.popups.push({widget:new e.PopUpWelcome(b),priority:g});break;case d.pop_up_blog_redirect:this.popups.push({widget:new e.PopUpBlogRedirect(b),priority:g})}},this),this.popups=b.filter(this.popups,function(a){return a.widget.isViewable()}),this.popups=b.sortBy(this.popups,"priority"),f.subscribe(f.EVENTS.ADD_MANAGED_POPUP,this.boundUnshift),f.subscribe(f.EVENTS.CANCEL_ALL_MANAGED_POPUPS,this.boundEmpty),c(b.bind(this._onWindowReady,this))},g.prototype._onWindowReady=function(){f.unsubscribe(f.EVENTS.ADD_MANAGED_POPUP,this.boundUnshift),f.unsubscribe(f.EVENTS.CANCEL_ALL_MANAGED_POPUPS,this.boundEmpty),this.popups.length>0&&this.popups[0].widget.openPopUp()},g.prototype.unshift=function(a){return this.popups.unshift({priority:0,widget:a})},g.prototype.empty=function(){this.popups=[]}}.call(this),function(a){"use strict";var b=a._,c=NR.resolve("SDM.Core.Components.BrooklynAuth"),d=NR.resolve("SDM.Core.Widgets"),e=SDM.EmailSignup||(SDM.EmailSignup={}),f=NR.resolve("SDM.Subscription"),g=NR.resolve("SDM.Util"),h=c.Repository;d.EmailSignup=function(a){new Vue({created:function(){this.isAuthenticated=e.IsLoggedIn,this.isSignedUp=g.getValueFromCookie("salesforceSubscription"),this.isAuthenticated&&h.getUserEmail().done(b.bind(function(a){this.email=a},this)).fail(b.bind(function(a){console.log(a)},this))},data:function(){return{email:"",errors:{email:!1,isConsenting:!1},instanceId:b.uniqueId("wgEs_"),isAuthenticated:!1,isConsenting:!1,isSending:!1,isSent:!1,isSignedUp:!1}},el:a.get(0),methods:{submit:function(){var a=this.$refs.signupForm.dataset.wgEsCasl||"";this.$refs.email&&(this.errors.email=!(this.email.length&&/\S+@\S+/.test(this.email))),this.$refs.consent&&(this.errors.isConsenting=!this.isConsenting),b.some(this.errors,function(a){return a})||(this.isSending=!0,f.signup(this.email,a).done(b.bind(function(){this.isSent=!0,g.saveCookie("salesforceSubscription","true")},this)).fail(b.bind(function(a){console.log(a)},this)).always(b.bind(function(){this.isSending=!1},this)))}},watch:{email:function(){this.email.length&&(this.errors.email=!1)},isConsenting:function(){this.isConsenting&&(this.errors.isConsenting=!1)}}})}}(this),function(a){"use strict";var b=a.jQuery,c=NR.resolve("SDM.Util"),d=NR.resolve("SDM.Subscription"),e=NR.resolve("SDM.Core.Components.BrooklynAuth.Repository"),f=a.SDM||(a.SDM={}),g=f.EmailSignupPopup||(f.EmailSignupPopup={}),h=NR.resolve("SDM.Core.Widgets"),i=h.EmailSignupPopup=function(a,c){c=c||{};var d={popupCookieName:"emailSignupPopup",subscriptionCookieName:"salesforceSubscription",isLoggedIn:"True"===g.IsLoggedIn,modalScrollY:window.scrollY,selectors:{close_button:"[data-wg-es-close-button]",modal:"[data-wg-es-modal]"}},e=b.extend(!0,{},d,c);this._init(a,e)};i.prototype._init=function(a,f){var g="",h=f.isLoggedIn,i=c.getValueFromCookie(f.popupCookieName),j=c.getValueFromCookie(f.subscriptionCookieName);i||j||(h?e.getUserEmail().done(function(b){g=b,d.isEmailSubscribed(g).done(function(b){b&&this._showPopup(a,f)}).fail(function(a){console.log(a)})}).fail(function(a){console.log(a)}):this._showPopup(a,f)),a.find(f.selectors.close_button).click(_.bind(function(){this._hidePopup(a,f)},this)),a.find(f.selectors.modal).click(_.bind(function(c){0===b(c.target).closest(".wg-esp__content-container").length&&a.hasClass("wg-esp--visible")&&this._hidePopup(a,f)},this))},i.prototype._showPopup=function(a,c){a.addClass("wg-esp--visible"),a.find(c.selectors.modal).velocity({top:"0%"},500,[210,19],function(){var c=b('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',a).first();c.length&&c.focus()}),setTimeout(function(){b(document.body).css("top","-"+c.modalScrollY+"px"),b(document.body).css("position","fixed"),b(document.body).css("width","100%")},0)},i.prototype._hidePopup=function(a,d){a.removeClass("wg-esp--visible"),a.find(d.selectors.modal).velocity({top:"100%"},300),setTimeout(function(){b(document.body).css("position",""),b(document.body).css("top",""),b(document.body).css("width","%"),window.scrollTo(0,d.modalScrollY)},0),c.saveCookie(d.popupCookieName,"true")}}(this),function(a){"use strict";var b=a.jQuery,c=NR.resolve("SDM.Util"),d=NR.resolve("SDM.Core.Widgets");(d.ImagePopup=function(a,c){c=c||{};var d={popupCookieName:"imagePopup",selectors:{content:"[data-wg-pu-content]",modal:'[data-widget="image-pop-up"]',modalCloseButton:"[data-wg-pu-hide-modal]"}},e=b.extend(!0,{},d,c);this._init(a,e)}).prototype._init=function(a,e){var f=c.getValueFromCookie(e.popupCookieName),g=a.find(e.selectors.modal);!f&&g.length>0&&new d.PopUp(g)._showModal(),a.find(e.selectors.modalCloseButton).on("click",function(){c.saveCookie(e.popupCookieName,"true")}),a.find(e.selectors.modal).on("click",_.bind(function(){0===b(event.target).closest(e.selectors.content).length&&c.saveCookie(e.popupCookieName,"true")},this))}}(this),function(a){"use strict";var b=a.NR||(a.NR={}),c=b.resolve("SDM.Core.Widgets"),d=b.resolve("SDM.Vue.Widgets"),e=b.resolve("SDM.Vue.Stores"),f=b.resolve("SDM.Data.FluShotFinderBanner");c.FluShotFinderBanner=function(a){var c=b.resolve("SDM.Vue.Vuex");c.hasModule("provinceSelector")||c.registerModule("provinceSelector",e.ProvinceSelector),new Vue({el:a[0],store:c,components:{provinceSelector:d.ProvinceSelector},mixins:[],data:function(){return{searchHeadline:"",searchSubHeading:"",searchDescription:""}},mounted:function(){this.updateSearchHeadline(this.userProvinceId)},methods:{updateSearchHeadline:function(a){this.searchHeadline=f.SearchHeadlinesPerProvince[a]},updateSearchSubHeadline:function(a){this.searchSubHeading=f.SearchSubHeadlinesPerProvince[a]},updateSearchDescription:function(a){this.searchDescription=f.SearchFieldDescriptionPerProvince[a]}},computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{}),watch:{userProvinceId:function(){this.updateSearchHeadline(this.userProvinceId),this.updateSearchSubHeadline(this.userProvinceId),this.updateSearchDescription(this.userProvinceId)}}})}}(this),function(a){var b=a._,c=a.jQuery,d=a.Vue,e=a.NR,f=e.resolve("SDM.Util"),g=e.resolve("SDM.Core.Widgets"),h=e.resolve("SDM.QuickSearchFrequencyDelay")||50,i=4,j={DEFAULT:"all",ARTICLES:"Article",CONDITIONS:"Condition",PRODUCTS:"Products"},k={ARTICLE:"Article",BRAND:"Brand",CATEGORIE:"Category",CONDITION:"Condition",PRODUCT:"Product"},l=function(a,b){switch(a){case k.CONDITION:return b.AllConditions;case k.PRODUCT:return b.AllProducts;default:return null}},m=function(a,c){if(!a)return[];var d=null,e=b.map(a.StructuredResult,function(c){var d=c.Filter,e=c.FilterName,f=l(d,a),g=d===k.PRODUCT||d===k.BRAND;return{categoryType:d,suggestions:b.map(((c.Result||{}).records||{}).page||[],function(a,b){return{suggestionId:d+"_"+String(b),imageUrl:g?a.image||"":"",title:a.title,url:a.url}}),title:e,viewAllLabel:f}});return c===j.DEFAULT&&a.FAQ.length&&(d={title:a.FAQLabel||"",suggestions:b.map(a.FAQ,function(a){return{title:a.Title,url:a.Link}})},e=e.concat(d)),b.filter(e,function(a){return a.suggestions.length>0})},n={beforeCreate:function(){this.API_URL="/"+f.getShortLanguageCode()+"/search/getstructuredsearch",this.FACET_MODES=j,this.focusTimeout=null},computed:{isDropdownOpen:function(){return this.isContainsFocusedEl&&(this.isFetchingSuggestions||this.allSuggestions.length||this.isShowErrorMessage||this.isShowNoResultsMessage)},allSuggestions:function(){return Array.prototype.concat.apply([],b.map(this.suggestionCategories,function(a){return a.suggestions}))},selectedSuggestion:function(){return-1===this.selectedIndex?null:this.allSuggestions[this.selectedIndex]}},created:function(){this.debouncedFetchSuggestion=b.debounce(this.fetchSuggestions,h),this.isPrefillQuery&&(this.query=(f.getUrlVars()||{}).query||"")},data:function(){return{currentRequest:null,hasFocus:!1,isContainsFocusedEl:!1,isFetchingSuggestions:!1,isShowErrorMessage:!1,isShowNoResultsMessage:!1,noResultsMessage:"",selectedIndex:-1,suggestionCategories:[],query:""}},methods:{decrementSelectedIndex:function(){this.isFetchingSuggestions||(this.selectedIndex-=1,this.selectedIndex<0&&(this.selectedIndex=0))},fetchSuggestions:function(){if(this.isShowErrorMessage=!1,this.isShowNoResultsMessage=!1,this.isFetchingSuggestions=!1,this.currentRequest&&this.currentRequest.abort(),this.query.length=this.allSuggestions.length&&(this.selectedIndex=this.allSuggestions.length-1))},makeViewAllUrl:function(a){return"/search?query="+encodeURIComponent(this.query)+"&srhtype="+encodeURIComponent(a.title.toLowerCase())},onFocusChange:function(){this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(b.bind(function(){var a=document.activeElement;this.hasFocus=b.some(this.$el.querySelectorAll("*"),function(b){return b===a})},this),50),this.focusTimeout=setTimeout(b.bind(function(){this.isContainsFocusedEl=this.hasFocus},this),h)},onNonSuggestionFocus:function(){this.selectedIndex=-1,this.onFocusChange()},onSubmit:function(){this.isShowErrorMessage=!1,this.isShowNoResultsMessage=!1,this.selectedIndex=-1,this.suggestionCategories=[],this.currentRequest&&(this.currentRequest.abort(),this.isFetchingSuggestions=!1)},onSuggestionFocus:function(a){this.selectedIndex=b.findIndex(this.allSuggestions,function(b){return b.suggestionId===a},this),this.onFocusChange()}},props:{errorMessage:{default:"",required:!1,type:String},facetMode:{default:j.DEFAULT,required:!1,type:String,validator:function(a){return b.indexOf(b.map(Object.keys(j),function(a){return j[a]}),a)>-1}},filters:{default:"",required:!1,type:String},hasAltStyling:{default:!1,required:!1,type:Boolean},isAlwaysSmallSubmit:{default:!1,required:!1,type:Boolean},inputPlaceholder:{required:!0,type:String},isPrefillQuery:{default:!1,required:!1,type:Boolean},submitLabel:{required:!0,type:String}},template:"#SearchBarV2Template",watch:{isContainsFocusedEl:function(){this.isContainsFocusedEl&&this.query&&!this.suggestionCategories.length&&this.fetchSuggestions()},query:function(){this.debouncedFetchSuggestion()},selectedSuggestion:function(){if(this.selectedSuggestion){var a=this.selectedSuggestion.suggestionId;this.$refs[a].length&&this.$refs[a][0].focus()}}}};g.SearchBar=function(a){new d({components:{searchBar:n},el:a.get(0)})}}(this),function(a,b){var c=a.NR||(a.NR={}),d=c.resolve("SDM.Core.Modules"),e=c.resolve("SDM.Core.Widgets"),f=c.resolve("SDM.Util"),g=a._,h=d.StoreLocatorPerService=function(a,c){c=c||{};var d={$el:a,selectors:{searchForm:"[data-md-slps-search-form]",searchInput:"[data-md-slps-search-input]",searchError:"[data-md-slps-search-error]",finder:"[data-md-slps-finder]",map:"[data-md-slps-map]",finderLoading:"[data-md-slps-finder-loading]",store:"[data-md-slps-store]",storeList:"[data-md-slps-store-list]",storeListPrevious:"[data-md-slps-store-list-previous]",storeListNext:"[data-md-slps-store-list-next]",storeHourPopUp:"[data-slps-store-hours-pop-up]",storeInfoStore:"[data-md-slps-store-info-store]",storeInfoStoreHours:"[data-md-slps-store-info-store-hours]"},classes:{storeListCollapse:"md-slps__store-list--collapse",loadingVisible:"md-slps__loading--visible"},data:{storeId:"md-slps-store-id",storeInfoStoreId:"md-slps-store-info-store-id",storeInfoStoreHoursId:"md-slps-store-info-store-hours-id",serviceCodes:"md-slps-service-codes",customPinSrc:"md-slps-custom-pin-src",markerLabel:"md-slps-marker-label"},templates:{storeList:"#store-locator-per-service-store-list-template",storeInfo:"#store-locator-per-service-store-info-template"},mapOptions:{center:{lat:43.6532,lng:-79.3832},zoom:10},stores:{},storeNotificationStores:{},storeListCurrentPage:1,storeHoursPopUps:{}};this.config=b.extend(!0,{},d,c);var e=SDM.Util.loadGoogleMapsApi();!0===e?this._init():b.when(e).then(g.bind(function(){this._init()},this))};h.prototype._init=function(){this._initMap(),this._initPopUps(),this._initSearch()},h.prototype._initGeolocation=function(){b.when(this._getGeolocation()).then(g.bind(function(a){if(a){var b=a.coords.latitude,c=a.coords.longitude;this.map.setCenter({lat:b,lng:c}),this._getStores({latitude:b,longitude:c,radius:"500",unit:"km",lookup:"nearby",filters:this.config.$el.data(this.config.data.serviceCodes).split(",").map(function(a){return a+":TRUE"}).join(","),rpp:"3"})}},this))},h.prototype._getGeolocation=function(){var a=b.Deferred();return navigator.geolocation?navigator.geolocation.getCurrentPosition(function(b){a.resolve(b)},function(b){console.log(b),a.resolve(null)}):a.resolve(null),a.promise()},h.prototype._initSearch=function(){var a=b(this.config.$el.find(this.config.selectors.searchForm)),c=a.find(this.config.selectors.searchInput),d=f.getUrlVars(),e=d.search;e&&""!==e?(c[0].value=decodeURIComponent(e),this._searchFormSubmit()):this._initGeolocation(),a.submit(g.bind(this._onSearchFormSubmit,this))},h.prototype._onSearchFormSubmit=function(a){this._searchFormSubmit(),a.preventDefault()},h.prototype._searchFormSubmit=function(){var a=b(this.config.$el.find(this.config.selectors.searchForm)),c=a.find(this.config.selectors.searchInput),d=c[0].value;""!==d&&(f.setUrlVars({search:d}),this.config.storeListCurrentPage=1,this._queryMap(d))},h.prototype._initMap=function(){this.config.mapOptions.mapTypeId=a.google.maps.MapTypeId.ROADMAP,this.map=new a.google.maps.Map(b(this.config.selectors.map)[0],this.config.mapOptions),this.geocoder=new a.google.maps.Geocoder,this.markers=[]},h.prototype._initPopUps=function(){var a=b(this.config.$el.find(this.config.selectors.storeNotificationPopUp));this.config.storeNotificationPopUp=new e.PopUp(a);var c=b(this.config.$el.find(this.config.selectors.storeReminderPopUp));this.config.storeReminderPopUp=new e.PopUp(c)},h.prototype._queryMap=function(a){this.geocoder.geocode({address:a},g.bind(this._geocoderCallback,this))},h.prototype._geocoderCallback=function(b,c){if(c===a.google.maps.GeocoderStatus.OK){this.config.$el.find(this.config.selectors.searchError).hide();var d=b[0].geometry.location;this.map.setCenter(d),this._getStores({latitude:d.lat(),longitude:d.lng(),radius:"500",unit:"km",lookup:"nearby",filters:this.config.$el.data(this.config.data.serviceCodes).split(",").map(function(a){return a+":TRUE"}).join(","),rpp:"3"})}else this.config.$el.find(this.config.selectors.searchError).show()},h.prototype._getStores=function(a){this._clearAllMarkers(),this.config.$el.find(this.config.selectors.finderLoading).addClass(this.config.classes.loadingVisible),b.ajax({method:"GET",url:"/"+f.getShortLanguageCode()+"/store/getstores",data:a}).done(g.bind(function(a){a&&(this.config.storeHoursPopUps={},this._renderStoreList(JSON.parse(a)),this._addMarkerToMap(JSON.parse(a)),this.config.$el.find(this.config.selectors.finderLoading).removeClass(this.config.classes.loadingVisible),this._initStorePopUp(JSON.parse(a).results))},this)).fail(function(a){console.log(a)})},h.prototype._addMarkerToMap=function(a){if(0!==a.results.length){this.bounds=new google.maps.LatLngBounds;for(var c=g.template(b(this.config.templates.storeInfo).html()),d=0;d0){this.config.$el.find(this.config.selectors.storeList).removeClass(this.config.classes.storeListCollapse);var c=g.template(b(this.config.templates.storeList).html());this.config.$el.find(this.config.selectors.storeList).html(c({storeList:a.results,storeListCurrentPage:this.config.storeListCurrentPage,isStoreListLastPage:3*this.config.storeListCurrentPage>=a.count})),this.config.$el.find(this.config.selectors.storeListPrevious).on("click",g.bind(this._onStoreListPreviousClick,this,a)),this.config.$el.find(this.config.selectors.storeListNext).on("click",g.bind(this._onStoreListNextClick,this,a))}else this.config.$el.find(this.config.selectors.storeList).addClass(this.config.classes.storeListCollapse),this.config.$el.find(this.config.selectors.searchError).show()},h.prototype._onStoreListPreviousClick=function(a){this.config.storeListCurrentPage-=1,this._getStores(this._getUrlParametersAsObject(a.previous))},h.prototype._onStoreListNextClick=function(a){this.config.storeListCurrentPage+=1,this._getStores(this._getUrlParametersAsObject(a.next))},h.prototype._getUrlParametersAsObject=function(a){return JSON.parse('{"'+decodeURI(a).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')},h.prototype._initStorePopUp=function(a){for(var c=0;c0&&(this.hasCoupons=!0,this._initializePersonalizedCoupon(a)),a.find(this.config.selectors.recommended_flyer_products_container).length>0&&this._initializeRecommendedCoupon(a),m.subscribe(m.EVENTS.TAB_SWITCHED,b.bind(function(a){a.tabId===this.config.tab_ids.recommended_flyer&&this._updateFlyer()},this))},l.prototype._initializePersonalizedCoupon=function(a){var d=c(this.config.selectors.no_results_templates.loaded_coupons),e=c(this.config.selectors.no_results_templates.no_loaded_coupons);this.card=f.getInstance(),this.couponCollection=new g;var i=new h({model:this.couponCollection,getNoResultsHtml:b.bind(function(){return this.card.getLoadedCoupons().size()>0?d.html():e.html()},this)});i.overrideAddItemViewMethod(b.bind(function(a,b,c,d){d.isContinuityOptIn()&&c.addContinuityOptInClass(),b.html(c.el),a.append(b)},this)),this.$couponContainer=a.find(this.config.selectors.personalized_coupon_container),this.$viewAllCouponsButtonContainer=a.find(this.config.selectors.view_all_coupons_btn_container),this.$couponContainer.html(i.el),this.couponCollection.onCouponRemoveComplete(function(){this._updatePersonlizedCoupons()},this),this.couponCollection.onListSet(this._toggleViewAllCouponsButton,this),this.card.onSimpleDataReady(b.bind(function(){this._updatePersonlizedCoupons(),this._pushPersonalizedCouponAnalytics()},this)).getAllCoupons().onCouponLoaded(b.bind(function(a){this._removePersonlizedCoupons(a)},this)),this.card.fetchSimpleData()},l.prototype._updatePersonlizedCoupons=function(){var a=this.card.getExclusiveContinuityOptInCoupons().add(this.card.getExclusiveCoupons().models).first(3);this.couponCollection.setList(a).fetchDetails()},l.prototype._removePersonlizedCoupons=function(a){this.couponCollection.removeCoupons(a)},l.prototype._toggleViewAllCouponsButton=function(){var a=this.card.getAllAvailableCoupons().size()>0;this.$viewAllCouponsButtonContainer.toggle(a)},l.prototype._initializeRecommendedCoupon=function(a){this.flyerModelCollection=new i,this.flyerViewModelCollection=new i,this.$flyerContainer=a.find(this.config.selectors.recommended_flyer_products_container),this.flyerListView=new j({model:this.flyerViewModelCollection}),this.$flyerContainer.html(this.flyerListView.el),this.flyerModelCollection.fetchSimple().done(b(function(){this.flyerViewModelCollection.setList(this.flyerModelCollection.first(6)).fetchDetails()}).bind(this)).fail(b(function(){this.flyerViewModelCollection.trigger("error-fetch")}).bind(this))},l.prototype._updateFlyer=function(){this.flyerListView.adjustTextAreaSize()}}.call(this),function(){var a=this,b=a.jQuery,c=a.NR||(a.NR={}),d="sdm-overlay",e=c.resolve("SDM.Core.Modules"),f=e.Overlays=function(a,c){var d={selectors:{close:"[data-md-ovl-close]",grey_bg:"[data-md-ovl-gry]",overlay:"[data-md-ovl-oly]",background:"[data-md-ovl-bg]",image:"[data-md-ovl-image]",html:"html"}};this.config=b.extend(!0,d,c||{}),this.$element=a,this._initialize(a)};f.prototype._initialize=function(){this._setInstanceVars(),b(window).on("becometowide."+d,_(function(){this._switchModeToDesktop()}).bind(this)),b(window).on("becometonarrow."+d,_(function(){this._switchModeToMobile()}).bind(this)),SDM.Util.isWindowWide()&&this._openOverlay()},f.prototype._setInstanceVars=function(){this.$image=b(this.config.selectors.image),this.imageLoaded=SDM.Util.loadImage(this.$image.attr("src")),this.$close=b(this.config.selectors.close),this.$grey_bg=b(this.config.selectors.grey_bg),this.$overlay=b(this.config.selectors.overlay),this.$background=b(this.config.selectors.background),this.$html=b(this.config.selectors.html)}, f.prototype._openOverlay=function(){this.imageLoaded.done(_.bind(function(){var a=this.$background.height();this.$grey_bg.css({height:a}),this.$html.css("overflow","hidden"),this.$grey_bg.fadeIn(),this.$overlay.fadeIn(),this.$element.css("overflow","auto");var b=_(this._closeOverlay).bind(this);this.$close.off("click."+d).on("click."+d,b)},this))},f.prototype._switchModeToMobile=function(){this._closeOverlay()},f.prototype._switchModeToDesktop=function(){this._openOverlay()},f.prototype._closeOverlay=function(){this.$element.css("overflow","hidden").fadeOut(),this.$html.css("overflow","auto")}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.Backbone,e=d.SharedSimpleRouter.getInstance(),f=a.Accordion,g=a.NR||(a.NR={}),h=g.resolve("SDM.Core.Modules"),i=h.AccordionContentList=function(a,b){var d={selectors:{accordion:"[data-wg-acl-accordion]",accordion_button:"[data-wg-acl-accordion-button]",accordion_content:"[data-wg-acl-accordion-content]"},attributes:{content_id:"data-wg-acl-content-id",is_first_item_expanded:"data-wg-acl-is-first-item-expanded",use_router:"data-wg-acl-use-router"},moveDuration:300,useRouter:!1};this.config=c.extend(!0,d,b||{}),this._initialize(a)};i.prototype._initialize=function(a){this.useRouter="true"===a.attr(this.config.attributes.use_router),this.isFirstItemExpanded=!this.useRouter&&"true"===a.attr(this.config.attributes.is_first_item_expanded),this.accordion$Elements=b(a.find(this.config.selectors.accordion)).map(b(function(a){var b=c(a);return{id:b.attr(this.config.attributes.content_id),$element:b}}).bind(this)),this.accordionObjects=b(this.accordion$Elements).map(b(function(a){var b=new f(a.$element,{selectors:{button:this.config.selectors.accordion_button,content:this.config.selectors.accordion_content}});return{id:a.id,accordion:b}}).bind(this)),this.useRouter&&(this.$scrollParent=this.$scrollParent||c("html, body"),this._setupRouter(),this._bindClickEvent()),this.isFirstItemExpanded&&this.accordionObjects.length&&b(this.accordionObjects).first().accordion.open()},i.prototype._openAccordion=function(a){return b(this.accordionObjects).find(function(b){return b.id===a}).accordion.open()},i.prototype._closeAccordionsExcept=function(a){var d=[];return b(this.accordionObjects).each(function(b){b.id!==a&&d.push(b.accordion.close())}),c.when.apply(c,d)},i.prototype._moveToAccordion=function(a){var c=b(this.accordion$Elements).find(function(b){return b.id===a}).$element;return this.$scrollParent.animate({scrollTop:c.offset().top-SDM.Util.getScrollOffset()},this.config.moveDuration).promise()},i.prototype._moveToTop=function(){return this.$scrollParent.animate({scrollTop:0},this.config.moveDuration).promise()},i.prototype._setupRouter=function(){var a=b(this.accordionObjects).map(function(a){return a.id}),d=new RegExp("^(?!"+a.join("|")+")");e.on(d,b(function(){this._closeAccordionsExcept(null).done(b(function(){this._moveToTop()}).bind(this))}).bind(this)),b(this.accordionObjects).each(b(function(a){e.on(a.id,b(function(){c.when(this._openAccordion(a.id),this._closeAccordionsExcept(a.id)).done(b(function(){this._moveToAccordion(a.id)}).bind(this))}).bind(this))}).bind(this)),e.historyStart()},i.prototype._bindClickEvent=function(){b(this.accordionObjects).each(function(a){a.accordion.onClickButton(b(function(){e.navigate(a.id,{trigger:!0})}).bind(this))})}}.call(this),function(a){"use strict";var b=a.jQuery,c=a._,d=a.NR||(a.NR={}),e=d.resolve("SDM"),f=d.resolve("SDM.Core.Modules"),g=d.resolve("SDM.Core.Components.Blog"),h=e.Util,i=g.BlogHeader,j=g.BlogHeaderView;(f.BeautyBlogPostDetails=function(a,c){c=c||{};var d={classes:{active_categories_toggle_btn:"wg-bbh-categories-toggle-active",search_term_input_expanded:"wg-bbh-search-input-expanded"},data_attributes:{title:"md-bbpd-title",tweet_via:"md-bbpd-tweet-via"},selectors:{categories:"[data-wg-bbh-categories]",categories_toggle_btn:"[data-wg-bbh-cat-toggle-btn]",header:"[data-widget-beauty-blog-header]",search:"[data-wg-bbh-list-search]",search_form:"[data-wg-bbh-search-form]",search_term_input:'[name="q"]',facebook_btn:"[data-md-bbpd-facebook-btn]",pinterest_btn:"[data-md-bbpd-pinterest-btn]",twitter_btn:"[data-md-bbpd-twitter-btn]",image:"[data-md-bbpd-image]"}};this.config=b.extend(!0,{},d,c),this.$element=a,this._initialize(this.$element,this.config)}).prototype._initialize=function(d,e){this.title=d.data(e.data_attributes.title)||"",this.$image=d.find(this.config.selectors.image),new j({el:b(this.config.selectors.header,d).get(0),model:new i,config:this.config}),h.loadPinterestApi(),b(this.config.selectors.facebook_btn,d).on("click",c.bind(function(a){var b=this.$image.attr("src");0===b.indexOf("//")&&(b="https:"+b),FB.ui({method:"feed",display:"popup",link:document.location.href,name:this.title,picture:b.length>0?b:null},c.noop),a.preventDefault()},this)),b(this.config.selectors.pinterest_btn,d).on("click",c.bind(function(b){a.PinUtils&&a.PinUtils.pinOne({url:document.location.href,media:this.$image.attr("src")||"",description:this.title}),b.preventDefault()},this)),b(this.config.selectors.twitter_btn,d).on("click",c.bind(function(d){var e=b(d.currentTarget),f=e.attr("href"),g=document.location.href,h=e.data(this.config.data_attributes.tweet_via)||"",i={url:g,text:this.title.substring(0,140),via:h};f+="?"+c.map(i,function(a,b){return b+"="+encodeURIComponent(a)}).join("&"),a.open(f,"twitter_share_dialog","width=550,height=450"),d.preventDefault()},this))}}(this),function(a){"use strict";var b=a.jQuery,c=a._,d=a.Backbone,e=a.NR||(a.NR={}),f=e.resolve("SDM.Core.Modules"),g=e.resolve("SDM.Core.Components.Blog"),h=e.resolve("SDM.Util"),i=g.BlogListing,j=g.BlogListingView,k=g.BlogPost,l=g.BlogPostCollection,m=g.Category,n=g.CategoryCollection,o=g.Pagination,p=g.Router,q=g.SortTypeCollection,r=f.BeautyBlogPosts=function(a,c){c=c||{};var d={classes:{active_categories_toggle_btn:"wg-bbh-categories-toggle-active",active_category_item:"wg-bbh-category-item-active",active_sort_item:"md-bbp-sort-item-active",post_image:"wg-bli-image",search_term_input_expanded:"wg-bbh-search-input-expanded"},data_attributes:{api_path:"md-bbp-api-path",category_id:"wg-bbh-cat-id",category_path:"wg-bbh-cat-path",destination_id:"md-bpp-destination-id",featuredcontent_id:"md-bpp-featured-content-id",homepage_title:"md-bbp-home-title",num_results_per_page:"md-bbp-num-results-per-page",pagination_btn_num:"md-bbp-pagination-btn",post_id:"wg-bli-id",post_path_prefix:"md-bbp-post-path-prefix",router_root:"md-bbp-router-root",sort_btn_type:"md-bbp-sort-btn"},selectors:{body:"[data-md-bpp-body]",categories:"[data-wg-bbh-categories]",category_btn:"[data-wg-bbh-cat-btn]",categories_toggle_btn:"[data-wg-bbh-cat-toggle-btn]",clear_category_btn:"[data-md-bbp-cat-clear]",header:"[data-widget-beauty-blog-header]",pagination:"[data-md-bbp-pagination]",no_results_template:"[data-md-bbp-no-results-tmpl]",no_server_template:"[data-md-bbp-no-server-tmpl]",pagination_btn:"[data-md-bbp-pagination-btn]",pagination_btn_next:"[data-md-bbp-pagination-btn-next]",pagination_btn_prev:"[data-md-bbp-pagination-btn-prev]",pagination_template:"[data-md-bbp-pagination-tmpl]",post_loading:"[data-wg-bli-post-loading]",post_template:"[data-md-bbp-post-tmpl]",posts:"[data-md-bbp-posts]",posts_loading_template:"[data-md-bbp-posts-loading-tmpl]",search:"[data-wg-bbh-list-search]",search_form:"[data-wg-bbh-search-form]",search_term_input:'[name="q"]',search_status:"[data-md-bbp-search-status]",search_status_template:"[data-md-bbp-search-status-tmpl]",search_clear_btn:"[data-md-bbp-clear-search-btn]",sort_btn:"[data-md-bbp-sort-btn]",sort_type_default:"[data-md-bbp-sort-type-default]",sort_types:"[data-md-bbp-sort-types]",sticky_post:"[data-md-bbp-sticky-post]",sticky_post_template:"[data-md-bbp-sticky-post-tmpl]",sticky_post_image_loading:"[data-md-bbp-sticky-image-loading]",title:"[data-wg-bbh-title]"},speeds:{fade_in:"slow",fade_out:"fast",scroll_duration:.5}};this.config=b.extend(!0,{},d,c),this.$element=a,this._initalize(this.$element,this.config)};r.prototype._initalize=function(a,e){var f=a.data(e.data_attributes.api_path),g=a.data(e.data_attributes.destination_id),h=a.data(e.data_attributes.featuredcontent_id),p=a.data(e.data_attributes.homepage_title),r=a.data(e.data_attributes.num_results_per_page),s=a.data(e.data_attributes.post_path_prefix);k.prototype.path_prefix=s;var t=function(a){var b=a.data(e.data_attributes.category_path)||"/";return 0!==b.indexOf("/")&&(b="/"+b),b},u=new n(c.map(b(e.selectors.category_btn,a),function(a){var c=b(a);return new m({category_id:c.data(e.data_attributes.category_id),path:t(c),title:c.text()||""})},this)),v=new q(c.map(b(e.selectors.sort_btn,a),function(a){var c=b(a);return new d.Model({type:c.data(e.data_attributes.sort_btn_type),is_default:c.is(e.selectors.sort_type_default)})},this)),w=new l([],{url:f}),x=new o({num_results_per_page:r}),y=new i({categories:u,destination_id:g,featuredcontent_id:h,homepage_title:p,pagination_model:x,posts:w,sort_types:v,sort_type:v.getDefault().get("type")});this._initalizeRouter(a,e,y),new j({el:a.get(0),config:e,model:y}).render()},r.prototype._initalizeRouter=function(a,b,e){var f=a.data(b.data_attributes.router_root),g=new p;g.on("route:category",function(a){if(!a)return void e.setCategoryId(null);0!==a.indexOf("/")&&(a="/"+a);var b=e.get("categories").findWhere({path:a});if(!b)return void e.setCategoryId(null);e.setCategoryId(b.id)},this),g.listenTo(e,"set-category-id",function(a){var b=a.getActiveCategory()||a.getNullCategory();g.navigate(b.get("path"))}),g.listenTo(e,"set-search-term",function(a,b){if(c.isEmpty(b))return void g.navigate(a.getNullCategory().get("path"));g.navigate("/search?q="+encodeURIComponent(b))}),g.on("route:search",function(){var a=h.getUrlVars(),b=a.q||"";e.setSearchTerm(b)},this),d.history.start({pushState:!0,root:f})}}(this),function(a){var b=a.jQuery,c=a._,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Modules"),f=d.resolve("SDM.Util");(e.BeautyBrandsListing=function(a,c){c=c||{};var d={animation_duration_sec:500,selectors:{brand_nav:"[data-md-bbl-brand-navigation]",letter_group:"[data-md-bbl-letter-group]"}},e=b.extend(!0,d,c||{});this._init(a,e)}).prototype._init=function(a,d){this.$element=a,this.config=d,this.$element.on("click",this.config.selectors.letter_group,c.bind(function(a){var c=b(a.currentTarget).attr("href"),d=this.$element.find(c);0!==d.length&&f.scrollTo$ElementAsync(d,this.config.animation_duration_sec)},this))}}(this),function(){var a=this,b=a.console,c=a.jQuery,d=a._,e=a.NR||(a.NR={}),f=e.resolve("SDM.Core.Modules"),g=f.BmiCalculator=function(a,b){var d={classes:{custom_radio_button_has_error:"wg-crb-has-error",field_has_error:"md-bmi-calc-calculator-field-has-error"},selectors:{bmi:"[data-md-bmi-calc-bmi]",bmi_container:"[data-md-bmi-calc-bmi-container]",button_submit:"[data-md-bmi-calc-button-submit]",calculator_header:"[data-md-bmi-calc-calculator-header]",custom_radio_button:".widget-custom-radio-button",form:"[data-md-bmi-calc-form]",field:"[data-md-bmi-calc-field]",input_units:'[name="md-bmi-calc-units"]',input_height:'[name="md-bmi-calc-height"]',input_weight:'[name="md-bmi-calc-weight"]',val_error:"[data-md-bmi-calc-val-error]",val_empty_height:"[data-md-bmi-calc-val-empty-height]",val_empty_weight:"[data-md-bmi-calc-val-empty-weight]",val_empty_units:"[data-md-bmi-calc-val-empty-units]",val_invalid_height:"[data-md-bmi-calc-val-invalid-height]",val_invalid_weight:"[data-md-bmi-calc-val-invalid-weight]"}};b=b||{},this.config=c.extend(!0,d,b),this._initialize(a)};g.fn=g.prototype,g.CONSTANTS={MIN_WEIGHT_IN_KG:25,MAX_WEIGHT_IN_KG:250,MIN_HEIGHT_IN_CM:100,MAX_HEIGHT_IN_CM:250,CM_PER_METRE:100,INCHES_PER_CM:2.54,LBS_PER_KG:2.2},g.UNITS={INVALID:0,METRIC:1,IMPERIAL:2},g.DURATIONS={HIDE_RESULT:100,SHOW_RESULT:600,HIDE_VAL_ERRORS:200,SHOW_VAL_ERRORS:400},g.VAL_ERRORS={EMPTY_UNITS:0,EMPTY_HEIGHT:1,EMPTY_WEIGHT:2,INVALID_HEIGHT:3,INVALID_WEIGHT:4},g.fn._initialize=function(a){this.$element=a,this._bindTextInputBlur(),this._bindTextInputKeyDown(),this._bindUnitsChange(),this._bindFormSubmit()},g.fn._bindTextInputBlur=function(){var a=[this.config.selectors.input_height,this.config.selectors.input_weight].join(", ");this.$element.on("blur",a,d.bind(this._onTextInputBlur,this))},g.fn._bindTextInputKeyDown=function(){var a=[this.config.selectors.input_height,this.config.selectors.input_weight].join(", ");this.$element.on("keydown",a,d.bind(this._onTextInputKeyDown,this))},g.fn._bindUnitsChange=function(){var a=this.config.selectors.input_units||"";this.$element.on("change",a,d.bind(this._onUnitsChange,this))},g.fn._bindFormSubmit=function(){var a=this.config.selectors.form||"";this.$element.on("submit",a,d.bind(this._onFormSubmit,this))},g.fn._onFormSubmit=function(a){var b=this._getRawValues()||{},c=this._getValidationErrors(b);0===c.length?(this._hideInvalidFields(d.values(g.VAL_ERRORS)),this._hideAllValidationMessages(),this._updateResult(this._getBmiFromRawValues(b))):(this._showInvalidFields(c),this._updateAllValidationMessages(c)),a.preventDefault()},g.fn._onTextInputBlur=function(a){if(!0!==c(a.relatedTarget).is(this.config.selectors.button_submit)){var b=c(a.currentTarget),d=b.is(this.config.selectors.input_height),e=b.is(this.config.selectors.input_weight),f=this._getRawValues();if((!0!==d||f.height)&&(!0!==e||f.weight)){var h=g.VAL_ERRORS.INVALID_HEIGHT,i=g.VAL_ERRORS.INVALID_WEIGHT,j=this._getValidationErrors(f),k=this._hasError(j,h),l=this._hasError(j,i);!0===d?!0===k?(this._showValidationMessages([h]),this._showInvalidFields([h])):(this._hideValidationMessages([h]),this._hideInvalidFields([h])):!0===e&&(!0===l?(this._showValidationMessages([i]),this._showInvalidFields([i])):(this._hideValidationMessages([i]),this._hideInvalidFields([i])))}}},g.fn._onTextInputKeyDown=function(a){if(13!==(a.keyCode||a.which)){var b=c(a.currentTarget),d=this.config.selectors.input_height,e=this.config.selectors.input_weight,f=[];b.is(d)?f=[g.VAL_ERRORS.EMPTY_HEIGHT,g.VAL_ERRORS.INVALID_HEIGHT]:b.is(e)&&(f=[g.VAL_ERRORS.EMPTY_WEIGHT,g.VAL_ERRORS.INVALID_WEIGHT]),this._hideResult(),this._hideInvalidFields(f),this._hideValidationMessages(f)}},g.fn._onUnitsChange=function(){var a=g.VAL_ERRORS.EMPTY_UNITS,b=g.VAL_ERRORS.INVALID_HEIGHT,c=g.VAL_ERRORS.INVALID_WEIGHT,d=this._getRawValues(),e=this._getValidationErrors(d),f=this._hasError(e,b),h=this._hasError(e,c);this._hideResult(),this._hideInvalidFields([a]),this._hideValidationMessages([a]),d.height&&(!0===f?(this._showValidationMessages([b]),this._showInvalidFields([b])):(this._hideValidationMessages([b]),this._hideInvalidFields([b]))),d.weight&&(!0===h?(this._showValidationMessages([c]),this._showInvalidFields([c])):(this._hideValidationMessages([c]),this._hideInvalidFields([c])))},g.fn._getBmiFromRawValues=function(a){var b=this._parseRawUnits(a.units),c=this._getCentimetres(this._parseRawFloat(a.height),b),d=this._centimetresToMetres(c),e=this._getKilograms(this._parseRawFloat(a.weight),b);return 0===d?0:e/(d*d)},g.fn._getCentimetres=function(a,b){return!1===this._isValidUnits(b)?0:!0===this._isMetric(b)?a:this._inchesToCentimetres(a)},g.fn._getElementChildren=function(a,c){c=c||"";var d=a.find(c);return 0===d.length&&b.log("No child elements exists with selector: ["+c+"]."),d},g.fn._getFormattedBmi=function(a){a=Math.round(100*(a||0))/100;var b=a.toString().split(".");return b[0]+"."+((b[1]||"")+"00").slice(0,2)},g.fn._getKilograms=function(a,b){return!1===this._isValidUnits(b)?0:!0===this._isMetric(b)?a:this._poundsToKilograms(a)},g.fn._getRawValues=function(){return{height:this._getRawHeightValue(),weight:this._getRawWeightValue(),units:this._getRawUnits()}},g.fn._getRawHeightValue=function(){var a=this.config.selectors.input_height||"";return this.$element.find(a).val()||""},g.fn._getRawUnits=function(){var a=this.config.selectors.input_units||"";return this.$element.find(a+":checked").val()||""},g.fn._getRawWeightValue=function(){var a=this.config.selectors.input_weight||"";return this.$element.find(a).val()||""},g.fn._getValidationErrors=function(a){var b=this._parseRawFloat(a.height),c=this._parseRawFloat(a.weight),d=this._parseRawUnits(a.units),e=this._getCentimetres(b,d),f=this._getKilograms(c,d),h=[],i=this._isValidUnits(d);return!1===i&&h.push(g.VAL_ERRORS.EMPTY_UNITS),a.height?b<=0?h.push(g.VAL_ERRORS.INVALID_HEIGHT):!0===i&&!1===this._isValidHeightInCentimetres(e)&&h.push(g.VAL_ERRORS.INVALID_HEIGHT):h.push(g.VAL_ERRORS.EMPTY_HEIGHT),a.weight?c<=0?h.push(g.VAL_ERRORS.INVALID_WEIGHT):!0===i&&!1===this._isValidWeightInKilograms(f)&&h.push(g.VAL_ERRORS.INVALID_WEIGHT):h.push(g.VAL_ERRORS.EMPTY_WEIGHT),h},g.fn._getValidationElementFromError=function(a){return a===g.VAL_ERRORS.EMPTY_UNITS?this._getElementChildren(this.$element,this.config.selectors.val_empty_units).get(0):a===g.VAL_ERRORS.EMPTY_HEIGHT?this._getElementChildren(this.$element,this.config.selectors.val_empty_height).get(0):a===g.VAL_ERRORS.EMPTY_WEIGHT?this._getElementChildren(this.$element,this.config.selectors.val_empty_weight).get(0):a===g.VAL_ERRORS.INVALID_HEIGHT?this._getElementChildren(this.$element,this.config.selectors.val_invalid_height).get(0):a===g.VAL_ERRORS.INVALID_WEIGHT?this._getElementChildren(this.$element,this.config.selectors.val_invalid_weight).get(0):null},g.fn._isMetric=function(a){return a===g.UNITS.METRIC},g.fn._isValidHeightInCentimetres=function(a){return g.CONSTANTS.MIN_HEIGHT_IN_CM<=a&&a<=g.CONSTANTS.MAX_HEIGHT_IN_CM},g.fn._isValidWeightInKilograms=function(a){return g.CONSTANTS.MIN_WEIGHT_IN_KG<=a&&a<=g.CONSTANTS.MAX_WEIGHT_IN_KG},g.fn._isValidUnits=function(a){return a===g.UNITS.METRIC||a===g.UNITS.IMPERIAL},g.fn._hasError=function(a,b){return d.indexOf(a,b)>-1},g.fn._parseRawFloat=function(a){return a&&!0===d.isArray(a.match(/^\d*(\.\d+)?$/))?parseFloat(a):0},g.fn._parseRawUnits=function(a){return a=(a||"").toUpperCase(),g.UNITS[a]||g.UNITS.INVALID},g.fn._centimetresToMetres=function(a){return a/g.CONSTANTS.CM_PER_METRE},g.fn._inchesToCentimetres=function(a){return a*g.CONSTANTS.INCHES_PER_CM},g.fn._poundsToKilograms=function(a){return a/g.CONSTANTS.LBS_PER_KG},g.fn._hideInvalidFields=function(a){var b=this.config.selectors.field||"",c=this.config.classes.field_has_error||"",d=this.config.classes.custom_radio_button_has_error,e=this._hasError(a,g.VAL_ERRORS.EMPTY_UNITS),f=this._hasError(a,g.VAL_ERRORS.EMPTY_HEIGHT)||this._hasError(a,g.VAL_ERRORS.INVALID_HEIGHT),h=this._hasError(a,g.VAL_ERRORS.EMPTY_WEIGHT)||this._hasError(a,g.VAL_ERRORS.INVALID_WEIGHT);return!0===e&&this._getElementChildren(this.$element,this.config.selectors.custom_radio_button).removeClass(d),!0===f&&this._getElementChildren(this.$element,this.config.selectors.input_height).parents(b).first().removeClass(c),!0===h&&this._getElementChildren(this.$element,this.config.selectors.input_weight).parents(b).first().removeClass(c),this},g.fn._showInvalidFields=function(a){var b=this.config.selectors.field||"",c=this.config.classes.field_has_error||"",d=this.config.classes.custom_radio_button_has_error||"",e=this._hasError(a,g.VAL_ERRORS.EMPTY_UNITS),f=this._hasError(a,g.VAL_ERRORS.EMPTY_HEIGHT)||this._hasError(a,g.VAL_ERRORS.INVALID_HEIGHT),h=this._hasError(a,g.VAL_ERRORS.EMPTY_WEIGHT)||this._hasError(a,g.VAL_ERRORS.INVALID_WEIGHT);return!0===e&&this._getElementChildren(this.$element,this.config.selectors.custom_radio_button).addClass(d),!0===f&&this._getElementChildren(this.$element,this.config.selectors.input_height).parents(b).addClass(c),!0===h&&this._getElementChildren(this.$element,this.config.selectors.input_weight).parents(b).addClass(c),this},g.fn._hideAllValidationMessages=function(){return this._getElementChildren(this.$element,this.config.selectors.val_error).hide(),this},g.fn._hideValidationMessages=function(a){var b=c.map(a,d.bind(this._getValidationElementFromError,this));c(b).fadeOut()},g.fn._showValidationMessages=function(a){var b=g.DURATIONS.SHOW_VAL_ERRORS||"slow",e=c.map(a,d.bind(this._getValidationElementFromError,this));return c(e).fadeIn(b),this},g.fn._updateAllValidationMessages=function(a){return this._hideAllValidationMessages(),this._showValidationMessages(a),this},g.fn._hideResult=function(a){a=a||d.noop,this._getElementChildren(this.$element,this.config.selectors.bmi_container).slideUp(g.DURATIONS.HIDE_RESULT,a)},g.fn._showResult=function(a){this._getElementChildren(this.$element,this.config.selectors.bmi).text(this._getFormattedBmi(a)),this._getElementChildren(this.$element,this.config.selectors.bmi_container).slideDown(g.DURATIONS.SHOW_RESULT)},g.fn._updateResult=function(a){var b=function(){this._showResult(a)};this._hideResult(d.bind(b,this))}}.call(this),function(){var a=this,b=a.jQuery,c=a._,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Modules"),f=d.resolve("SDM.Core.Utils"),g=d.resolve("SDM.ContactUs.Forms"),h=d.resolve("SDM.Util"),i=f.ReCaptchaFactory,j=e.ContactUs=function(a,c){var d={urls:{answers_by_question:"/search/GetAllResultsByQuery"},rating_helpful:100,rating_unhelpful:0,character_limit:100,character_limit_label:"{0}",character_limit_delay:2e3,scroll_to_customer_help_duration_ms:1e3,inquiry:{selectors:{detail_forms:"[data-md-ctus-inquiry-detail-forms]",selected_category:"[data-md-ctus-inquiry-selected-category]",detail_template:"[data-md-ctus-inquiry-detail-tmpl]",inquiry_dropdown:"[data-md-ctus-inquiry-dropdown]",next_button:"[data-inquiry-next-button]",back_button:"[data-inquiry-back-button]",submit_button:"[data-inquiry-submit-button]"}},classes:{help_toggle_expanded:"md-ctus__customer-help-toggle--expanded"},selectors:{customer_help:"[data-md-ctus-customer-help]",customer_help_toggle:"[data-ctus-customer-help-toggle]",radio_container:"[data-md-ctus-inquiry-radio-container]"}};this.config=b.extend(!0,d,c||{}),this._initialize(a)};j.fn=j.prototype,j.fn._initialize=function(a){this.$element=a,this.$element.on("click",this.config.selectors.customer_help_toggle,c.bind(function(){b(this.config.selectors.customer_help,this.$element).is(":visible")?this._closeHelpSection():this._openHelpSection()},this)),this.$element.on("keydown",c.bind(function(a){var c=b(event.target);if(c.is(this.config.selectors.radio_container)){a.which===32&&(b('input[type="radio"]',c).prop("checked",!0),a.preventDefault())}},this)),this._initializeInquiry()},j.fn._initializeInquiry=function(){var a=c.template(b(this.config.inquiry.selectors.detail_template,this.$element).html());b(this.config.inquiry.selectors.detail_forms).html(a({inquireForms:g.Data})),this.$element.on("change",this.config.inquiry.selectors.selected_category,c.bind(this._onInquiryCategoryChange,this)),this.$element.on("click",this.config.inquiry.selectors.next_button,c.bind(this._onInquiryNextButtonClick,this)),this.$element.on("click",this.config.inquiry.selectors.back_button,c.bind(this._onInquiryBackButtonClick,this)),this.$element.on("click",this.config.inquiry.selectors.submit_button,c.bind(this._onInquirySubmitButtonClick,this)),this.$element.on("keydown","[data-inquiry-input=pcoptimum]",c.bind(this._onPCOptimumInputKeyDown,this)),this.$element.on("keydown","[data-inquiry-input=phone]",c.bind(this._onPhoneInputKeyDown,this)),this.$element.on("keydown","[data-inquiry-input=numeric]",c.bind(this._onNumericInputKeyDown,this));var d=this.$element.find("[data-md-ctus-inquiry-detail-form]");this.reCaptcha=[];for(var e=0;e0&&(b("[data-inquiry-submit-button="+h+"]")[0].disabled=!1)}},j.fn._renderReCaptcha=function(a,d){i.getReCaptchaAsync().done(c.bind(function(e){this.reCaptcha[d]=e,e.render(a,c.bind(function(a){a.length>0&&(b("[data-inquiry-submit-button="+d+"]")[0].disabled=!1)},this),c.bind(function(){b("[data-inquiry-submit-button="+d+"]")[0].disabled=!0},this))},this))},j.fn._onInquiryCategoryChange=function(a){this.$element.find(this.config.inquiry.selectors.next_button)[0].disabled=!1,a.preventDefault()},j.fn._onPCOptimumInputKeyDown=function(a){var c=b(a.currentTarget).find("input");b.isNumeric(a.key)&&19!==c[0].value.length||8===a.keyCode||9===a.keyCode||a.preventDefault()},j.fn._onPhoneInputKeyDown=function(a){var c=b(a.currentTarget).find("input");b.isNumeric(a.key)&&10!==c[0].value.length||8===a.keyCode||9===a.keyCode||a.preventDefault()},j.fn._onNumericInputKeyDown=function(a){b.isNumeric(a.key)||8===a.keyCode||9===a.keyCode||a.preventDefault()},j.fn._onInquiryNextButtonClick=function(a){var c=b("option:selected",b(this.config.inquiry.selectors.selected_category)),d=c.val();this.$element.find("[data-md-ctus-inquiry-selection]").hide(),this.$element.find("[data-md-ctus-inquiry-detail-form="+d+"]").show(),this.$element.find("[data-md-ctus-inquiry-detail-form="+d+"] .md-ctus__inquiry-heading").focus(),h.scrollTo$ElementAsync(b(".md-ctus__inquiry")),a.preventDefault()},j.fn._onInquiryBackButtonClick=function(a){this.$element.find("[data-md-ctus-inquiry-detail-form]").hide(),this.$element.find("[data-md-ctus-inquiry-selection]").show(),this.$element.find("[data-md-ctus-inquiry-selection] .md-ctus__inquiry-heading").focus(),h.scrollTo$ElementAsync(b(".md-ctus__inquiry")),a.preventDefault()},j.fn._onInquirySubmitButtonClick=function(a){var c=b(a.currentTarget).parents("form"),d=this;this._validateForm(c)&&(g.Payload.reason_code_level_1__c=b(c).data().inquiryReason,g.Payload.Banner_Email__c=b(c).data().inquiryBannerEmail,this._fillPayload(c,g.Payload,""),h.scrollTo$ElementAsync(b(".md-ctus__inquiry")),b("[data-md-ctus-inquiry-loading]").show(),b.ajax({contentType:"application/x-www-form-urlencoded",type:"POST",url:"/Global/SubmitInquiry",data:{data:JSON.stringify(g.Payload)}}).done(function(a){var c=JSON.parse(a);"OK"===c.Status?(b("[data-md-ctus-inquiry-external-id]")[0].innerHTML=g.Payload.web_external_id__c,b("[data-md-ctus-inquiry-case-id]")[0].innerHTML=c.CaseID):"FAIL"===c.Status&&(b("[data-md-ctus-inquiry-response]")[0].innerHTML=c.ErrorMessage)}).always(function(){b("[data-md-ctus-inquiry-detail-form]").hide(),b("[data-md-ctus-inquiry-loading]").hide(),b("[data-md-ctus-inquiry-response]").show(),d.$element.find("[data-md-ctus-inquiry-response]").focus()})),a.preventDefault()},j.fn._fillPayload=function(a,b,c){for(var d in b)if(b.hasOwnProperty(d)){var e=a.find("[data-inquiry-key='"+c+d+"']");if(0!==e.length){var f=e.data().inquiryInput,g=e.find("input, textarea, select");"radio"===f&&(g=e.find("input:checked")),0!==g.length&&(b[d]="postal"===f?g[0].value.replace(/\s/g,""):g[0].value)}else"object"==typeof b[d]&&this._fillPayload(a,b[d],c+d+",")}},j.fn._validateForm=function(a){for(var c=a.find("[data-inquiry-input]"),d=!0,e=!1,f=0;f0&&(10!==u.value.length||!/^\d+$/.test(u.value))){j[0].innerHTML=l,d=!1,e=this._setFirstInputFocus(u,e);continue}}else if("email"===i){var v=/^(([abcdefg.hijklmnopqrstuvwxyz!#$%&'*/=?^_+-`{|}~0123456789]+))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(u.value.length>0&&!v.test(u.value)){j[0].innerHTML=l,d=!1,e=this._setFirstInputFocus(u,e);continue}}else if("numeric"===i){if(u.value.length>0&&!/^\d+$/.test(u.value)){j[0].innerHTML=l,d=!1,e=this._setFirstInputFocus(u,e);continue}}else if("postal"===i){if(u.value.length>0&&!h.validatePostalCode(u.value)){j[0].innerHTML=l,d=!1,e=this._setFirstInputFocus(u,e);continue}}else if("pcoptimum"===i&&u.value.length>0&&(19!==u.value.length||!/^\d+$/.test(u.value))){j[0].innerHTML=l,d=!1,e=this._setFirstInputFocus(u,e);continue}if(o){var w=a.find("[data-inquiry-confirmation-id="+p+"] input");if(w[0].value!==w[1].value){j[0].innerHTML=m,d=!1,e=this._setFirstInputFocus(w[1],e);continue}}}}return d},j.fn._setFirstInputFocus=function(a,c){return c||(a.focus(),h.scrollTo$ElementAsync(b(a),500,20)),!0},j.fn._openHelpSection=function(){var a=this.config.classes.help_toggle_expanded||"",c=b(this.config.selectors.customer_help,this.$element);c.stop().slideDown(),c.addClass(a)},j.fn._closeHelpSection=function(){var a=this.config.classes.help_toggle_expanded||"",c=b(this.config.selectors.customer_help,this.$element);c.stop().slideUp(),c.removeClass(a)}}.call(this),function(){var a,b,c,d,e,f,g,h,i=this,j=i._,k=i.jQuery,l=i.Backbone,m=i.NR||(i.NR={}),n=m.resolve("SDM.Core.Components"),o=m.resolve("SDM.Core.Modules"),p=o.VideoPlayerMVC=function(a,b){var c={attributes:{add_rating_endpoint:"data-md-vpm-add-rating-url",filter_view:"data-wg-tbg-content",get_paginated_videos_endpoint:"data-md-vpm-get-paginated-videos-url",get_video_by_friendly_name_endpoint:"data-md-vpm-get-video-by-friendly-name-url",increment_views_endpoint:"data-md-vpm-increment-views-url",root_url:"data-md-vpm-root-url"},classes:{now_playing_container_hidden:"md-vpm-now-playing-hidden",tab_content_active:"wg-tcl-active",tab_hidden:"md-vpm-tab-hidden"},selectors:{active_tab_content:".wg-tcl-active",module_wrapper:"[data-vpm-mod-wrapper]",now_playing_details:"[data-md-vpm-now-playing-details]",tab_content_template:"[data-md-vpm-tab-content-template]",tab_filter_selector:"[data-vpm-tabs-select]",video_item_template:"[data-md-vpm-video-item-template]",video_player_container:"[data-md-vpm-video-player-container]",video_player_template:"[data-md-vpm-video-player-template]"},most_recent_tab_button:"most-recent",video_base_url:"details/"};this.config=k.extend(!0,c,b||{}),this._initialize(a)},q=m.resolve("SDM"),r=m.resolve("SDM.Core.Components.VideoPlayer"),s=n.PaginationModel,t=n.PaginationView;d=l.Model.extend({config:{rating_cookie:"ShoppersVideoStats",v3_youtube_api_key:"AIzaSyAqyipvzq62aB7-5OZ35FiVAp4T2WszDTM"},idAttribute:"Id",defaults:{Cats:"",Duration:"0:00",Friendly:"",MaxRating:5,Rating:1,RatingsCount:0,ThumbnailUrl:"",Title:"",Views:0},getExternalData:function(){if(!0===j.isEmpty(this.get("YouId"))&&!0===j.isEmpty(this.get("VimId")))return this.trigger("external-data-failed"),void console.log("A vimeo id or a youtube id is required on the video.");var a=this.get("YouId"),b=this.get("VimId");a?k.when(this.getYoutubeVideoData(a)).then(j(this.handleYoutubeVideoDataResponse).bind(this)).fail(j(function(){this.trigger("external-data-failed")}).bind(this)):b&&k.when(this.getVimeoVideoData(b)).then(j(this.handleVimeoVideoDataResponse).bind(this)).fail(function(){this.trigger("external-data-failed")})},getFormattedDuration:function(a){if(!0===j.isUndefined(a))return this.defaults.Duration;if(!0===j.isNaN(a))return this.defaults.Duration;var b=a%60,c=Math.floor(a/60),d=Math.floor(a/3600);return d>0?d+":"+("00"+c).slice(-2)+":"+("00"+b).slice(-2):c+":"+("00"+b).slice(-2)},getFormattedRating:function(a){return!0===j.isUndefined(a)?this.defaults.Rating:!0===j.isNaN(a)?this.defaults.Rating:Math.min(Math.round(a),this.defaults.MaxRating)},getFormattedThumbnailUrl:function(a){if(!0===j.isUndefined(a))return this.defaults.thumbnail_url;var b=this.get("VideoThumbnail");return b&&!0===b.hasOwnProperty("URL")?b.URL:a},getFormattedViews:function(a){ if(!0===j.isUndefined(a))return this.defaults.Views;if(!0===j.isNaN(a))return this.defaults.Views;for(var b=a.toString(),c=/(\d+)(\d{3})/;!0===c.test(b);)b=b.replace(c,"$1, $2");return b},getYoutubeId:function(a){var b="";if(!(a.indexOf("?v=")>-1))return a.substring(a.lastIndexOf("/")+1);var c=a.match(/[.]*?v=([^&]*)?/);return c.length>1&&(b=c[1]),b},getYoutubeVideoData:function(a){var b=this.config.v3_youtube_api_key,c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b+"&part=snippet,contentDetails";return k.ajax({dataType:"jsonp",method:"GET",url:c}).fail(j(function(){this.trigger("external-data-failed")}).bind(this))},parseYoutubeApiV3DurationIntoSeconds:function(a){var b=new RegExp(/^PT((\d*)H)?((\d*)M((\d*)S)?)?/i),c=b.exec(a);return 60*(parseInt(c[2],10)||0)*60+60*(parseInt(c[4],10)||0)+(parseInt(c[6],10)||0)},getVimeoVideoData:function(a){return k.ajax({dataType:"jsonp",method:"GET",url:"//vimeo.com/api/v2/video/"+a+".json"})},handleYoutubeVideoDataResponse:function(a){if(!a.items||!a.items.length)return void this.trigger("external-data-failed");var b,c;a.items[0].snippet&&a.items[0].snippet.thumbnails&&a.items[0].snippet.thumbnails.high&&(b=a.items[0].snippet.thumbnails.high.url,this.set("ThumbnailUrl",this.getFormattedThumbnailUrl(b),{silent:!0})),a.items[0].contentDetails&&a.items[0].contentDetails.duration&&(c=a.items[0].contentDetails.duration,this.set("Duration",this.getFormattedDuration(this.parseYoutubeApiV3DurationIntoSeconds(c)),{silent:!0})),this.trigger("external-data-loaded")},handleVimeoVideoDataResponse:function(a){!1!==j.isArray(a)&&!1!==j.isObject(a[0])&&(!0===j.has(a[0],"duration")&&this.set("Duration",this.getFormattedDuration(a[0].duration),{silent:!0}),!0===j.has(a[0],"thumbnail_medium")&&this.set("ThumbnailUrl",this.getFormattedThumbnailUrl(a[0].thumbnail_medium),{silent:!0}),this.trigger("external-data-loaded"))},getRatedIdsFromCookie:function(){var a=q.Util.getValueFromCookie(this.config.rating_cookie);return a?decodeURIComponent(a).split(","):[]},isRated:function(){for(var a=this.getRatedIdsFromCookie(),b=0,c=a.length;b1&&this.$pagination_container.show(),this}}),p.prototype._initialize=function(a){this.$element=a,this.current_video=new e,this.tab_content_views={};var b=this.$element.find(this.config.selectors.module_wrapper);return this.is_now_playing_video_container_hidden=b.length>0&&b.is("."+this.config.classes.now_playing_container_hidden),this.add_rating_endpoint=this.$element.attr(this.config.attributes.add_rating_endpoint),Boolean(this.add_rating_endpoint)?(this.increment_views_endpoint=this.$element.attr(this.config.attributes.increment_views_endpoint),Boolean(this.increment_views_endpoint)?(this.get_paginated_videos_endpoint=this.$element.attr(this.config.attributes.get_paginated_videos_endpoint),Boolean(this.get_paginated_videos_endpoint)?(this.get_video_by_friendly_name_endpoint=this.$element.attr(this.config.attributes.get_video_by_friendly_name_endpoint),Boolean(this.get_video_by_friendly_name_endpoint)?(this.root_url=this.$element.attr(this.config.attributes.root_url),Boolean(this.root_url)?(this._setupPrototypesVars(),this._setupTabGroups(a),this._setupTabContentViews(),this._setupNowPlayingViews(),this.current_video.on("user-selected-video-set",function(a){this.setPlayingVideo(a,!0,!0)},this),this.current_video.on("default-video-set",function(a){this.setPlayingVideo(a,!1,!1)},this),void this._setupRouter()):void console.log("A "+this.config.attributes.root_url+" attribute is required.")):void console.log("A "+this.config.attributes.get_video_by_friendly_name_endpoint+" attribute is required.")):void console.log("A "+this.config.attributes.get_paginated_videos_endpoint+" attribute is required.")):void console.log("A "+this.config.attributes.increment_views_endpoint+" attribute is required.")):void console.log("A "+this.config.attributes.add_rating_endpoint+" attribute is required.")},p.prototype.setCurrentVideoUrl=function(a){var b=this.config.video_base_url;this.router.navigate(b+a)},p.prototype._setupPrototypesVars=function(){e.prototype.get_paginated_videos_endpoint=this.get_paginated_videos_endpoint,e.prototype.get_video_by_friendly_name_endpoint=this.get_video_by_friendly_name_endpoint,d.prototype.add_rating_endpoint=this.add_rating_endpoint,d.prototype.increment_views_endpoint=this.increment_views_endpoint,h.prototype.events=h.prototype.events||{},h.prototype.events["click [md-vpm-listing-item-thumbnail]"]="onThumbnailClick",h.prototype.template=j.template(k("[data-md-vpm-video-list-item-template]").html()),h.prototype.loading_template=j.template(k("[data-md-vpm-video-list-item-loading-template]").html()),h.prototype.current_video=this.current_video},p.prototype._setupTabGroups=function(){this.filter_select=this.$element.find(this.config.selectors.tab_filter_selector),this.filter_select.on("change",j(function(){this.clearPlayingVideo();var a=this.filter_select.val();this._triggerTabViewReload(a),this.router.navigate(a)}).bind(this))},p.prototype._triggerTabViewReload=function(a,b){b=b||{};var c=this.tab_content_views[a].model,d=this._getContentViewElementWrapped(a);if(this._setActiveTab(d),0===c.get("current_page"))c.set("current_page",1,{trigger_scroll:!1,ignore_set_default_video:b.has_default_video});else{var e=c.get("videos");e.size()>0?this.setPlayingVideo(e.first(),!1,!1):this.hideNowPlayingContainer()}},p.prototype._getContentViewElementWrapped=function(a){return k("["+this.config.attributes.filter_view+"="+a+"]")},p.prototype._setActiveTab=function(a){typeof a!==k&&(a=k(a)),this.$element.find("."+this.config.classes.tab_content_active).removeClass(this.config.classes.tab_content_active),a.addClass(this.config.classes.tab_content_active)},p.prototype._setupNowPlayingViews=function(){this.now_playing_player_view=new b({el:this.config.selectors.video_player_container,model:this.current_video})},p.prototype._setupTabContentViews=function(){this.filter_select.find("option").each(j(function(a,b){var c=k(b),d=c.val(),h=this._getContentViewElementWrapped(d);if(!h.length)return void console.log("Cannot find corresponding tab view for label: "+d+".");var i=h.attr("data-md-vpm-sort-id")||"0",j=h.attr("data-md-vpm-category-id")||"",l=new e,m=new g({sort:i,category_id:j,videos:l});l.on("reset",function(a,b){b=b||{},0===this.current_video.size()&&(a.size()>0?(!0===this.is_now_playing_video_container_hidden&&this.showNowPlayingContainer(),b.ignore_set_default_video||this.current_video.setAsDefault(a.first())):this.hideNowPlayingContainer())},this),l.on("start-loading",function(){this.clearPlayingVideo()},this);var n=new f({el:h,model:m});n.on("video-selected",this.setCurrentVideo,this),this.tab_content_views[d]=n}).bind(this))},p.prototype.hideNowPlayingContainer=function(){return this.is_now_playing_video_container_hidden=!0,this.$element.find(this.config.selectors.module_wrapper).addClass(this.config.classes.now_playing_container_hidden),this},p.prototype.showNowPlayingContainer=function(){return this.is_now_playing_video_container_hidden=!1,this.$element.find(this.config.selectors.module_wrapper).removeClass(this.config.classes.now_playing_container_hidden),this},p.prototype.scrollToVideoContainer=function(){var a=this.$element.find(this.config.selectors.video_player_container),b=a.offset().top-q.Util.getScrollOffset()-30;TweenLite.to(k("body, html"),.5,{scrollTop:b})},p.prototype.setPlayingVideo=function(b,c,d){d=d&&!0===q.Util.isWindowWide(),this.current_video.reset(b,{trigger:!0}),!0===c&&b.get("Friendly")&&this.setCurrentVideoUrl(b.get("Friendly"));var e=this.$element.find(this.config.selectors.now_playing_details),f=new a({model:b});f.render(),e.html(f.el),this.now_playing_player_view.render(d),!0===this.is_now_playing_video_container_hidden&&this.showNowPlayingContainer(),this.scrollToVideoContainer()},p.prototype.clearPlayingVideo=function(){this.current_video.reset([],{trigger:!0}),this.$element.find(this.config.selectors.now_playing_details).empty()},c=l.Router.extend({routes:{"":"home","details(/:id)":"video",":tab":"tab","*notFound":"home"}}),p.prototype._setupRouter=function(){this.router=new c,this.router.on("route:home",this._navigateToDefaultRoute,this),this.router.on("route:video",function(a){if(!0===j.isNull(a))return void this._navigateToDefaultRoute();this._triggerTabViewReload(this.config.most_recent_tab_button,{has_default_video:!0}),this.current_video.fetchVideoByFriendlyName(a)},this),this.router.on("route:tab",function(a){!0===j.has(this.tab_content_views,a)?this.filter_select.val(a).trigger("change"):this._navigateToDefaultRoute()},this);var a=this.root_url;"/"!==a.charAt(a.length-1)&&(a+="/"),l.history.start({pushState:!0,root:a})},p.prototype._navigateToDefaultRoute=function(){this.router.navigate(this.filter_select.find("option").first().val(),{trigger:!0})}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.Backbone,e=a.NR||(a.NR={}),f=e.resolve("SDM.Core.Components.PopUp"),g=e.resolve("SDM.Core.Modules"),h="promo-badge";PromoBadge=g.PromoBadge=function(a,b){var d={selectors:{badge:"[data-md-pb-badge]"}};this.config=c.extend(!0,d,b||{}),this.$element=a,this._initialize()},PromoBadge.prototype._initialize=function(){this.modal=new PromoBadge.Modal,this._bindEvents()},PromoBadge.prototype._bindEvents=function(){var a=this.$element.find(this.config.selectors.badge),c=b(this._openModal).bind(this);a.on("click",c)},PromoBadge.prototype._openModal=function(){this.modal.open()},PromoBadge.Modal=d.View.extend({config:{selectors:{image_pc:"[data-md-pb-modal-image-pc]",image_mobile:"[data-md-pb-modal-image-mobile]",content:"[data-md-pb-modal-content]"}},initialize:function(){this.render();var a=this.$(this.config.selectors.image_pc),b=this.$(this.config.selectors.image_mobile),d=this.createImageLoadPromise(a),e=this.createImageLoadPromise(b);this.$window=c(window),this.has_pc_images=a.length>0,this.has_mobile_images=b.length>0,this.image_loader_promise=c.when([d,e]).promise()},isAbleToShowPopup:function(){return SDM.Util.isWindowWide()&&this.has_pc_images||!SDM.Util.isWindowWide()&&this.has_mobile_images},open:function(){this.image_loader_promise.done(b.bind(function(){this.isAbleToShowPopup()&&(this.popup=new f,this.popup.open(this.el),this.popup.onCloseCompleted(b(function(){this.unbindResizeEvents()}).bind(this)),this.bindResizeEvents())},this))},render:function(){var a=b.template(c("[data-md-pb-modal-tamplate]").html());this.setElement(a())},createImageLoadPromise:function(a){var d=b(a).map(function(a){var b=c.Deferred(),d=new Image;return c(d).on("load",function(){b.resolve()}),d.src=a.src,b.promise()});return c.when(d).promise()},switchModeToPC:function(){this.popup&&!this.has_pc_images&&this.popup.close()},switchModeToMobile:function(){this.popup&&!this.has_mobile_images&&this.popup.close()},bindResizeEvents:function(){this.$window.on("becometowide."+h+"-"+this.cid,b(this.switchModeToPC).bind(this)),this.$window.on("becometonarrow."+h+"-"+this.cid,b(this.switchModeToMobile).bind(this))},unbindResizeEvents:function(){this.$window.off("becometowide."+h+"-"+this.cid),this.$window.off("becometonarrow."+h+"-"+this.cid)}})}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR,e=d.resolve("SDM.Util"),f=d.resolve("SDM.Core.Modules"),g=d.resolve("SDM.PharmacyServicesList.Data"),h=d.resolve("SDM.Vue.Stores"),i=d.resolve("SDM.Vue.Widgets"),j="on",k=c(window),l=b.reduce(g.Categories,function(a,b){var c=b.Slug||(b.Title||"").toLowerCase().replace(/\s/g,"-");return a[c]={categoryId:String(b.ContentID),body:b.Body,legal:b.Legal,slug:c,title:b.Title,featuredArticle:b.FeaturedArticle,featuredArticleUrl:b.FeaturedArticleUrl},a},{}),m=function(a,c){c=c||{};var d=b.map(a,function(a){return{id:a.Abbreviation.toLowerCase(),label:a.Title.toLowerCase()}});return c.isExcludeQc&&(d=b.filter(d,function(a){return"qc"!==a.id})),d},n=function(a){return c.ajax({type:"GET",url:"/"+e.getShortLanguageCode()+"/PharmacyServices/GetServices",data:{province:a},contentType:"application/json; charset=utf-8",dataType:"json"}).then(function(a){var c=b.map(a,function(a){var b=a.PharmacyService;if(!b)return null;var c=(a.SafeTitle||"").toLowerCase();if(!c)return null;var d=null;return a.OverrideUrl&&(d={href:a.OverrideUrl,target:a.OverrideUrlTarget,text:a.OverrideUrlText}),{serviceId:c,categoryId:b.PharmacyServiceCategoryID?String(b.PharmacyServiceCategoryID):null,bodyHtml:b.Description,title:b.Title,url:d}});return b.filter(c,Boolean)})},o=function(a,c){return!(!a.length||!c)&&b.contains(b.map(a,function(a){return a.categoryId}),c)},p=function(a,c){return!(!a.length||!c)&&b.contains(b.map(a,function(a){return a.id}),c.toLowerCase())},q=function(a,c){return!(!a.length||!c)&&b.contains(b.map(a,function(a){return a.serviceId}),c.toLowerCase())};f.PharmacyServiceList=function(f){var r=d.resolve("SDM.Vue.Vuex");r.hasModule("provinceSelector")||r.registerModule("provinceSelector",h.ProvinceSelector),new Vue({beforeCreate:function(){this.isPharmaprix=(a.location.hostname||"").indexOf("pharmaprix")>-1,this.hasProvinceSelect=!this.isPharmaprix},beforeDestroy:function(){k.off("becometonarrow becometowide becometosmalldesktopwide becometoextrawide",this.onChangeBreakpoint)},components:{"province-selector":i.ProvinceSelector},computed:Object.assign({},Vuex.mapState("provinceSelector",["userProvinceId"]),{pageColumnWidth:function(){return Math.floor(100/this.maxNumServiceColumns)},selectedCategory:function(){return this.categorySlug?this.categoriesToShow.find(function(a){return a.slug===this.categorySlug},this)||null:null},servicePages:function(){return this.servicesToShow.length?b.reduce(this.servicesToShow,function(a,b,c){var d=c%this.maxNumServiceColumns;return a[d]||(a[d]=[]),a[d].push(b),a},[],this):[]},servicesToShow:function(){this.categorySlug||(this.categorySlug=g.Categories[0].Slug);var a=l[this.categorySlug];return a?this.services.filter(function(b){return b.categoryId===a.categoryId},this):this.services}}),created:function(){var a=e.getUrlVars(),b=a.province||this.userProvinceId||null;this.provinces=this.isPharmaprix?[]:m(g.Provinces,{isExcludeQc:!0}),this.setUserProvinceId(this.isPharmaprix?"qc":p(this.provinces,b)?b:null),this.isShowShareLocationPrompt=!this.userProvinceId,this.categorySlug=(a.category||"").toLowerCase()||null,this.serviceId=(a.service||"").toLowerCase()||null},data:function(){return{categoriesToShow:[],categorySlug:null,isLoading:!1,isShowShareLocationPrompt:!1,maxNumServiceColumns:3,provinces:[],serviceId:null,services:[]}},el:f.get(0),filters:{uppercase:function(a){return(a||"").toUpperCase()}},methods:Object.assign({},Vuex.mapActions("provinceSelector",["setUserProvinceId"]),{closeServiceEl:function(a,b){TweenLite.to(a,.4,{height:0,onComplete:b})},fetchServices:function(){this.isLoading=!0,n(this.userProvinceId).then(b.bind(function(a){this.services=a},this)).catch(function(a){console.error(a)}).always(b.bind(function(){this.isLoading=!1},this))},geoLocateUser:function(){var a=new c.Deferred;this.isShowShareLocationPrompt=!1,navigator.geolocation?navigator.geolocation.getCurrentPosition(function(b){a.resolve({lat:b.coords.latitude,lng:b.coords.longitude})},function(b){console.error(b),a.reject(b)}):a.reject(new Error("geolocation is not supported")),a.promise().then(function(a){return e.getProvinceId(a)}).then(b.bind(function(a){this.setUserProvinceId(a)},this)).catch(b.bind(function(a){console.error(a),this.setUserProvinceId(j)},this))},onChangeBreakpoint:function(){e.isWindowNarrow()?this.maxNumServiceColumns=1:e.isWindowWide()?this.maxNumServiceColumns=2:this.maxNumServiceColumns=3},openServiceEl:function(a,b){TweenLite.set(a,{height:"auto"}),TweenLite.from(a,.4,{height:0,onComplete:b})},selectService:function(a){this.serviceId=a,this.updateQuerystring()},setCategorySlug:function(a){this.categorySlug=a,this.updateQuerystring()},updateQuerystring:function(){var a={};!this.isPharmaprix&&this.userProvinceId&&(a.province=this.userProvinceId),this.categorySlug&&(a.category=this.categorySlug),this.serviceId&&(a.service=this.serviceId),e.setUrlVars(a)},useDefaultProvinceId:function(){this.isShowShareLocationPrompt=!1,this.setUserProvinceId(j)}}),mounted:function(){k.on("becometonarrow becometowide becometosmalldesktopwide becometoextrawide",this.onChangeBreakpoint),this.onChangeBreakpoint()},store:r,watch:{isShowShareLocationPrompt:function(){this.$refs.shareLocationPrompt&&(this.isShowShareLocationPrompt?this.$nextTick(b.bind(function(){b.each(document.body.querySelectorAll("button, [href], input, select, textarea"),function(a){a.tabIndex=-1}),b.each(this.$refs.shareLocationPrompt.querySelectorAll("button, [href], input, select, textarea"),function(a,b){a.tabIndex=0,0===b&&a.focus()})},this)):this.$nextTick(b.bind(function(){b.each(document.body.querySelectorAll("button, [href], input, select, textarea"),function(a){a.tabIndex=0})},this)))},userProvinceId:function(){this.userProvinceId?this.fetchServices():this.services=[],this.updateQuerystring()},services:function(){this.services.length?this.categoriesToShow=b.filter(b.map(b.keys(l),function(a){return l[a]}),function(a){return b.any(this.services,function(b){return b.categoryId===a.categoryId})},this):this.categoriesToShow=[],o(this.categoriesToShow,this.categoryId)||(this.categoryId=null),q(this.services,this.serviceId)||(this.serviceId=null),this.updateQuerystring()},servicesToShow:function(){q(this.servicesToShow,this.serviceId)||(this.serviceId=null),this.updateQuerystring()}}})}}(),function(){var a=this,b=a._,c=a.jQuery,d=a.NR,e=d.resolve("SDM.Util"),f=d.resolve("SDM.Core.Modules"),g=null,h=f.PharmacyServiceDetail=function(a,b,d){var e={url:"/PharmacyServices/GetServices",scrolled:!1,scrollOffset:SDM.Util.getScrollOffset()+10,selectors:{provinces_select:"[data-md-phsd-provinces-select]",provinces_label:"[data-md-phsd-province-label]",details_template:"[data-md-phsd-detail-template]",details_container:'[data-service-list="all"]',loading_template:"[data-md-phsd-loading-template]",accordion:"[data-md-phsd-accordion]",accordion_button:"[data-md-phsd-accordion-button]",accordion_content:"[data-md-phsd-accordion-content]",scroll_top:"[data-md-phsd-scroll-top]",scroll_to:"[data-md-phsd-scroll-to]"},attributes:{scroll_to:"data-md-phsd-scroll-to",link_name:"data-md-phsd-link-name"}};this.config=c.extend(!0,e,d||{}),this._initialize(a,b)};h.prototype._initialize=function(a,d){g=g||c("html, body"),this._setInstantVars(a,d),this.$provinces_select.on("change.pharmacy-services-details",b(this._updateList).bind(this)),this.$provinces_select.val(this.province).triggerHandler("change")},h.prototype._setInstantVars=function(a,d){this.$container=a,this.$details_container=this.$container.find(this.config.selectors.details_container),this.details_template=b.template(this.$container.find(this.config.selectors.details_template).html()||""),this.loading_template=b.template(this.$container.find(this.config.selectors.loading_template).html()||"");var e=SDM.Util.getUrlVars();this.service=e.service,this.service&&(this.service=this.service.toLowerCase()),this.province=e.province,this.province&&(this.province=this.province.toLowerCase()),this.$provinces_select=this.$container.find(this.config.selectors.provinces_select);var f=b(this.$provinces_select.find("option")).map(function(a){return c(a).val()});this.province||b.contains(f,this.province)||(this.province=(d||"").toLowerCase()),b.contains(f,this.province)||(this.province=f[0])},h.prototype._updateList=function(){this._showLoading(),this.province=this.$provinces_select.val(),this.provinceName=this.$provinces_select.find(":selected").text(),this.$container.find(this.config.selectors.provinces_label).html(this.provinceName),c.when(this._fetchList()).then(b(this._renderList).bind(this))},h.prototype._showLoading=function(){this.$details_container.html(this.loading_template())},h.prototype._fetchList=function(){return c.ajax({type:"GET",url:"/"+e.getShortLanguageCode()+this.config.url,data:{province:this.province},contentType:"application/json; charset=utf-8",dataType:"json"})},h.prototype._renderList=function(a){var d=this.details_template({services:a,active_service:this.service,province:this.province}),e={selectors:{button:this.config.selectors.accordion_button,content:this.config.selectors.accordion_content}};this.$details_container.html(d),this._updateQueryString(),b(this.$details_container.find(this.config.selectors.accordion)).each(function(a){var b=new Accordion(c(a),e);b.isActive()&&b.open(0)}),this._scrollToActive(),this._bindEvents()},h.prototype._bindEvents=function(){var a=b(this._scrollToTop).bind(this);this.$container.find(this.config.selectors.scroll_top).on("click",a);var c=b(this._changeActiveService).bind(this);this.$container.find(this.config.selectors.scroll_to).on("click",c)},h.prototype._updateQueryString=function(){var a=SDM.Util.getUrlVars();a.province=this.province,a.service=this.service,SDM.Util.setUrlVars(a)},h.prototype._changeActiveService=function(a){a.preventDefault();var b=c(a.currentTarget);this.service=b.attr(this.config.attributes.scroll_to),this._updateQueryString(),this._scrollToActive()},h.prototype._scrollToActive=function(){ var a=null;this.service&&""!==this.service&&(a=this.$container.find("["+this.config.attributes.link_name+"="+this.service+"]"),a.length>0&&this._scroll(a.offset().top))},h.prototype._scrollToTop=function(a){a.preventDefault(),this._scroll(0)},h.prototype._scroll=function(a){g.animate({scrollTop:a-this.config.scrollOffset},1e3)}}.call(this),function(){var a=this,b=a.NR,c=b.resolve("SDM.PharmacistQA");c.Initializer={init:function(){app=new Vue({el:"#pharmacist-qa",data:function(){return{isVideo:!0}},created:function(){},mounted:function(){},methods:{onVideoTabClick:function(){this.isVideo=!0},onTranscriptTabClick:function(){this.isVideo=!1}}})}},document.querySelector("#pharmacist-qa")&&c.Initializer.init()}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR,e=d.resolve("SDM.Util"),f=d.resolve("SDM.Core.Modules"),g=null,h=f.MinorAilmentsList=function(a,b,d){var e={url:"/PharmacyServices/GetMinorAilments",scrolled:!1,scrollOffset:SDM.Util.getScrollOffset()+10,selectors:{provinces_select:"[data-md-mal-provinces-select]",provinces_label:"[data-md-mal-province-label]",details_template:"[data-md-mal-detail-template]",details_container:"[data-md-mal-details-container]",loading_template:"[data-md-mal-loading-template]",accordion:"[data-md-mal-accordion]",accordion_button:"[data-md-mal-accordion-button]",accordion_content:"[data-md-mal-accordion-content]",scroll_top:"[data-md-mal-scroll-top]",scroll_to:"[data-md-mal-scroll-to]"},attributes:{scroll_to:"data-md-mal-scroll-to",link_name:"data-md-mal-link-name"}};this.config=c.extend(!0,e,d||{}),this._initialize(a,b)};h.prototype._initialize=function(a,d){g=g||c("html, body"),this.friendly_urls={},this._setInstantVars(a,d),this.$provinces_select.on("change.minor-ailments-list",b(this._updateList).bind(this)),this.$provinces_select.val(this.province).triggerHandler("change")},h.prototype._setInstantVars=function(a,d){this.$container=a,this.$details_container=this.$container.find(this.config.selectors.details_container),this.details_template=b.template(this.$container.find(this.config.selectors.details_template).html()||""),this.loading_template=b.template(this.$container.find(this.config.selectors.loading_template).html()||"");var e=SDM.Util.getUrlVars();this.province=e.province,this.province&&(this.province=this.province.toLowerCase()),this.$provinces_select=this.$container.find(this.config.selectors.provinces_select);var f=b(this.$provinces_select.find("option")).map(function(a){return c(a).val()});this.province||b.contains(f,this.province)||(this.province=(d||"").toLowerCase()),b.contains(f,this.province)||(this.province=f[0])},h.prototype._updateList=function(){this._showLoading(),this.province=this.$provinces_select.val(),this.provinceName=this.$provinces_select.find(":selected").text(),this.$container.find(this.config.selectors.provinces_label).html(this.provinceName),c.when(this._fetchList()).then(b(this._renderList).bind(this))},h.prototype._showLoading=function(){this.$details_container.html(this.loading_template())},h.prototype._fetchList=function(){return c.ajax({type:"GET",url:"/"+e.getShortLanguageCode()+this.config.url,data:{province:this.province},contentType:"application/json; charset=utf-8",dataType:"json"})},h.prototype._renderList=function(a){this.friendly_urls=b.reduce(a,function(a,b){return a[b.Title.toLowerCase()]=b.UrlFriendlyName,a},{});var d=SDM.Util.getUrlVars();d.ailment&&b.each(this.friendly_urls,function(a,b){if(a===d.ailment)return void(this.ailment=b)},this);var e=this.details_template({ailments:a,active_ailment:this.ailment||null,province:this.province}),f={selectors:{button:this.config.selectors.accordion_button,content:this.config.selectors.accordion_content}};this.$details_container.html(e),this._updateQueryString(),b(this.$details_container.find(this.config.selectors.accordion)).each(function(a){var b=new Accordion(c(a),f);b.isActive()&&b.open(0)}),this._bindEvents(),this.ailment&&this._scrollToActive()},h.prototype._bindEvents=function(){var a=b(this._scrollToTop).bind(this);this.$container.find(this.config.selectors.scroll_top).on("click",a);var c=b(this._changeActiveAilment).bind(this);this.$container.find(this.config.selectors.scroll_to).on("click",c)},h.prototype._updateQueryString=function(){var a=SDM.Util.getUrlVars(),b=this.friendly_urls[this.ailment];a.province=this.province,b&&(a.ailment=b),SDM.Util.setUrlVars(a)},h.prototype._changeActiveAilment=function(a){a.preventDefault();var b=c(a.currentTarget);this.ailment=b.attr(this.config.attributes.scroll_to),this._updateQueryString(),this._scrollToActive()},h.prototype._scrollToActive=function(){var a=null;this.ailment&&""!==this.ailment&&(a=this.$container.find("["+this.config.attributes.link_name+'="'+this.ailment+'"]'),a.length>0&&this._scroll(a.offset().top))},h.prototype._scrollToTop=function(a){a.preventDefault(),this._scroll(0)},h.prototype._scroll=function(a){g.animate({scrollTop:a-this.config.scrollOffset},1e3)}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.Backbone,e=a.NR||(a.NR={}),f=e.resolve("SDM.Core.Modules"),g=e.resolve("SDM.Core.Components"),h=g.CollapsibleButtonList,i=g.PaginationModel,j=g.PaginationView,k=f.BrandDetails=function(){new k.View};k.Model=d.Model.extend({defaults:{page:1,numRes:12,filters:{},prducts:{},type:"Product",categoryId:-1,isLBV:!1,getFilters:!0,numberOfPages:0,totalNumberOfResults:0},initialize:function(a,b){this.set("filters",new k.FilterModules),this.set("products",new k.Products),this.setBrand(b.brands),this.fetch();var c=this.getFilters();this.on("change:page",this.fetchNextPage),this.listenTo(c,"filters-updated",this.fetchWithNewFilter)},setBrand:function(a){var c=[];a=a.split(","),b.each(a,function(a){var b=new k.FilterModule.FilterOption;b.setValues(null,a,0,!0,1,a),c.push(b)},this),this.addFilters("BR","",c),this.addFilters("CAT","",[])},addFilters:function(a,b,c){this.get("filters").addFilter(a,b,c)},toJSON:function(){var a=b.clone(this.attributes),c=this.generateFilterString();return a.filters="type,"+this.get("type")+","+c,a=b.omit(a,["type","numberOfPages","totalNumberOfResults","products"])},generateFilterString:function(){var a=this.get("filters"),c=[];return a.each(function(a){var d=a.getType(),e=a.getSelectedOptions();b.isEmpty(e)?c.push(d+":"):b.each(e,function(a){c.push(d+":"+encodeURIComponent(a.getValue()))})}),c.join(",")},fetchWithNewFilter:function(){this.set({page:1},{silent:!0}),this.fetch()},fetchNextPage:function(){this.set("getFilters",!1),this.fetch()},fetch:function(){this.trigger("fetch-start"),c.ajax({url:this.url(),type:"POST",data:this.toJSON(),success:b(this.parse).bind(this),error:function(){console.log("error")}})},parse:function(a){var c=a.FilterModules;b.each(c,function(a){if(!b.isNull(a)){var c=a.Info[0],d=c.Prefix.replace(":",""),e=c.FilterName,f=[],g=0;b.each(a.Results,function(a){var b=new k.FilterModule.FilterOption;b.setValues(a.Type,a.Name,a.TotalResults,null,g,a.Id),f.push(b),g+=1},this),this.addFilters(d,e,f)}},this);var d=a.SwiftypeResults.records.page,e=[];b.each(d,function(a){e.push(a)},this),this.setProducts(e);var f=a.SwiftypeResults.info.page;this.set("numberOfPages",f.num_pages),this.set("totalNumberOfResults",f.total_result_count),this.trigger("data-fetched")},getFilters:function(){return this.get("filters")},getNumberOfResults:function(){return this.get("totalNumberOfResults")},getCurrentPage:function(){return this.get("page")},getNumberPerPage:function(){return this.get("numRes")},getNumberOfPages:function(){var a=parseInt(this.getNumberOfResults(),10),b=parseInt(this.getNumberPerPage(),10);return Math.ceil(a/b)},getProducts:function(){return this.get("products")},setCurrentPage:function(a){this.set("page",a)},setProducts:function(a){this.getProducts().setProducts(a)}}),k.View=d.View.extend({namespace:"sdm-brand-details-view",config:{selectors:{category_field:"[name=CategoryID]",brandName_field:"[name=Brands]",form:"[data-md-brnd-form]",header_container:"[data-md-brnd-products-header]",filter_container:"[data-md-brnd-products-filter]",products_container:"[data-md-brnd-products-list]",footer_container:"[data-md-brnd-products-pagination]"},templates:{header:"[data-widget-search-result-header-template]",loading:"[data-md-brnd-loading-template]"}},el:"[data-module='brand-details']",initialize:function(){var a=this.$(this.config.selectors.form);if(a.length>0){var d=this.$(this.config.selectors.category_field).val(),e=a.attr("action"),f=this.$(this.config.selectors.brandName_field).val();this.model=new k.Model({categoryId:d},{urlRoot:e,brands:f}),this.paginationModel=new i,this.paginationView=new j({model:this.paginationModel}),this.productGrid=new k.ProductGrid({products:this.model.getProducts()}),this.listenToOnce(this.model,"data-fetched",this.render),this.listenTo(this.model,"fetch-start",this.onFectchStart),c(window).on("becometowide."+this.namespace,b(function(){this.switchModeToDesktop()}).bind(this)),c(window).on("becometonarrow."+this.namespace,b(function(){this.switchModeToMobile()}).bind(this))}},switchModeToDesktop:function(){this.$(this.config.selectors.products_container).removeAttr("style")},switchModeToMobile:function(){this.$(this.config.selectors.products_container).removeAttr("style")},render:function(){this.setupPagination(),this.renderHeader(),this.renderFooter();var a=this.$(this.config.selectors.filter_container);this.model.getFilters().each(function(b){var c=b.renderView();c&&(a.append(c.$el),c.reinitializeScroller())},this),this.renderProductGrid(),this.listenTo(this.model,"data-fetched",this.updateView)},renderHeader:function(){var a=this.$(this.config.selectors.header_container),c=b.template(this.$(this.config.templates.header).html()),d=c({total_result_count:this.model.getNumberOfResults(),current_page:this.model.getCurrentPage(),per_page:this.model.getNumberPerPage()});a.html(d)},renderFooter:function(){this.$(this.config.selectors.footer_container).html(this.paginationView.$el)},renderProductGrid:function(){var a=this.$(this.config.selectors.products_container),b=this.productGrid.render().$el;a.html(b);var c=b.height();TweenLite.to(a,.5,{"min-height":c})},onFectchStart:function(){this.$(this.config.selectors.products_container).html("");var a=b.template(c(this.config.templates.loading).html())();this.$(this.config.selectors.header_container).html(a)},setupPagination:function(){this.paginationModel.setNumberOfPages(this.model.getNumberOfPages()),this.paginationModel.setCurrentPage(this.model.getCurrentPage()),this.paginationModel.onChangeCurrentPage(this.onPageChange,this)},onPageChange:function(){this.scrollTop(),this.model.setCurrentPage(this.paginationModel.getCurrentPage())},scrollTop:function(){var a=this.$(this.config.selectors.header_container).offset().top-(SDM.Util.getScrollOffset()+25);TweenLite.to(c("body, html"),.5,{scrollTop:a})},updateView:function(){this.renderHeader(),this.renderProductGrid(),this.setupPagination(),this.model.getFilters().trigger("data-fetched")}}),k.Products=d.Collection.extend({setProducts:function(a){this.set(a)}}),k.ProductGrid=d.View.extend({config:{analytics_event_label:"category"},initialize:function(a){this.products=a.products},render:function(){var a=b.template(c("[data-widget-product-grid-template]").html()),d=a({products:this.products.toJSON(),analytics_event_label:this.config.analytics_event_label});return this.setElement(d),this}}),k.FilterModules=d.Collection.extend({model:k.FilterModule,initialize:function(){this.on("filters-updated",this.onFiltersUpdated),this.on("data-fetched",this.updateView)},onFiltersUpdated:function(){this.disableFilters()},disableFilters:function(){this.each(function(a){a.trigger("disable-view")})},updateView:function(){this.each(function(a){a.trigger("update-view")})},addFilter:function(a,b,c){var d=this.findFilterModuleByType(a);if(d)d.setName(b),d.addOptions(c);else{var e=new k.FilterModule({type:a,name:b});e.addOptions(c),this.add(e)}},findFilterModuleByType:function(a){return this.find(function(b){return b.getType()===a},this)}}),k.FilterModule=d.Model.extend({defaults:{type:"",name:"",options:null},config:{brand_filter:"BR"},initialize:function(){if(this.set("options",new k.FilterModule.FilterOptions),this.getType()!==this.config.brand_filter){this.view=new k.FilterModuleView({model:this});var a=this.getOptions();this.updateComparator(),this.listenTo(a,"selection-updated",this.triggerReFetch)}},updateComparator:function(){this.get("type")===this.config.brand_filter&&this.getOptions().setComparatorToSortByAlphabet()},triggerReFetch:function(){this.trigger("filters-updated")},addOptions:function(a){this.get("options").set(a)},getType:function(){return this.get("type")},getSelectedOptions:function(){return this.get("options").getSelectedOptions()},getOptions:function(){return this.get("options")},getCount:function(){return this.getOptions().getCount()},renderView:function(){if(this.view)return this.view.render()},setName:function(a){this.get("name")!==a&&this.set("name",a)},clearAll:function(){this.getOptions().clearAll()},selectAll:function(){this.getOptions().selectAll()}}),k.FilterModuleView=d.View.extend({config:{selectors:{checkbox_container:"[data-wg-pf-cbl]",loading_continer:"[data-wg-pf-loading-container]"},template:"[data-widget-product-filters-generic-template]",special_templates:{BR:"[data-widget-product-filters-brand-template]"}},events:{"click [data-wg-pf-filter-clear-all-button]":"clearAll","click [data-wg-pf-filter-select-all-button]":"selectAll","click [data-wg-pf-alphabet-tab]":"scrollTo"},initialize:function(){this.listenTo(this.model,"disable-view",this.showLoading),this.listenTo(this.model,"update-view",this.update)},render:function(){var a=this.getTemplate(),b="",c={},d=this.model.attributes;return d.count=this.model.getCount(),b=a(d),this.setElement(b),this.cbl=new h({$container:this.$(this.config.selectors.checkbox_container)}),c=this.model.getOptions(),c.each(function(a){this.cbl.addItem(a.renderView().$el)},this),this},getTemplate:function(){var a=this.model.getType(),d=this.config.special_templates[a];return d=d||this.config.template,b.template(c(d).html())},update:function(){this.cbl.emptyList(),this.model.getOptions().each(function(a){this.cbl.addItem(a.renderView().$el)},this),this.reinitializeScroller(),this.hideLoading()},showLoading:function(){this.$(this.config.selectors.loading_continer).show()},hideLoading:function(){this.$(this.config.selectors.loading_continer).hide()},reinitializeScroller:function(){this.cbl.reinitializeScroller()},clearAll:function(a){a.preventDefault(),this.model.clearAll()},selectAll:function(a){a.preventDefault(),this.model.selectAll()},scrollTo:function(a){a.preventDefault();var b=c(a.target),d=b.data("wg-pf-alphabet-tab");this.$(".wg-pf-alphabet-tab-active").removeClass("wg-pf-alphabet-tab-active"),b.addClass("wg-pf-alphabet-tab-active");var e=this.$("[data-wg-pf-item-alphabet-group="+d+"]").first(),f=e.data("wg-clbl-item");this.cbl.scrollTo(f)}}),k.FilterModule.FilterOption=d.Model.extend({defaults:{id:"",value:"",name:"",label:"",type:"checkbox",total_results:0,order:0,first_letter:"",letter_group:""},letter_groups:{"a-c":["a","b","c"],"d-k":["d","e","f","g","h","i","j","k"],"l-p":["l","m","n","o","p"],"q-z":["q","r","s","t","u","v","w","x","y","z"]},initialize:function(){this.view=new k.FilterModule.FilterOptionView({model:this})},getValue:function(){return this.get("value")},isSelected:function(){return this.get("selected")},setValues:function(a,c,d,e,f,g){b.isNull(e)||this.set({selected:e},{silent:!0}),b.isNull(a)||this.set({type:a},{silent:!0}),b.isNull(g)&&(g=c),d=parseInt(d,10);var h=this.stripSpecialChars(c),i=h.charAt(0).toLowerCase();this.set({id:h,name:h,value:g,label:c+" ("+d+")",order:f,total_results:d,first_letter:i},{silent:!0}),this.setLetterGroup()},setLetterGroup:function(){b.each(this.letter_groups,function(a,c){b.find(a,function(a){return a===this.get("first_letter")},this)&&this.set({letter_group:c},{silent:!1})},this)},setSelected:function(a,b){this.set({selected:a},b)},stripSpecialChars:function(a){return a=a.replace(/[^\w\s]/gi,""),a=a.replace(/ /g,"_")},renderView:function(){return this.view.render()}}),k.FilterModule.FilterOptionView=d.View.extend({config:{selectors:{input:"[data-wg-pf-input]"}},initialize:function(){this.template=b.template(c("[data-wg-pf-filter-list-item-template]").html(),{evaluate:/\(\((.+?)\)\)/g,interpolate:/\(\(=(.+?)\)\)/g,escape:/\(\(-(.+?)\)\)/g})},events:{"change [data-wg-pf-input]":"toggleSelected"},render:function(){this.setElement(this.template(this.model.attributes));var a=this.model.isSelected();return this.$(this.config.selectors.input).prop("checked",a),this},toggleSelected:function(){var a=this.$(this.config.selectors.input),b=a.prop("checked");this.model.setSelected(b,{silent:!1})}}),k.FilterModule.FilterOptions=d.Collection.extend({model:k.FilterModule.FilterOption,comparator:"order",initialize:function(){this.on("change:selected",this.selectionUpdated)},selectionUpdated:function(){this.trigger("selection-updated")},getSelectedOptions:function(){return this.where({selected:!0,type:"checkbox"})},getCount:function(){return this.length},setComparatorToSortByAlphabet:function(){this.comparator="first_letter",this.sort()},clearAll:function(){this.each(function(a){a.setSelected(!1,{silent:!0})},this),this.trigger("selection-updated")},selectAll:function(){this.each(function(a){a.setSelected(!0,{silent:!0})},this),this.trigger("selection-updated")}})}.call(this),function(a){var b=this.NR||(this.NR={}),c=b.resolve("SDM.Core.Components"),d=b.resolve("SDM.Core.Modules"),e=d.CustomProductList||(d.CustomProductList={}),f={brands:"BR:",categories:"CT:"};e.Controller=function(a){this.config={View:new e.View({el:a,model:new e.ViewModel})}},e.Props=a.Model.extend({defaults:{products:e.Products,brands:e.Brands,categories:e.Categories}}),e.State=a.Model.extend({defaults:{products:[],brands:[],categories:[]}}),e.Filters=a.Model.extend({defaults:{brands:[],categories:[]},toggleFilter:function(a,b){if(!_.isEmpty(a)&&!_.isEmpty(b)){var c=_.invert(f)[a],d=this.get(c);_.indexOf(d,b)>=0?this.removeFilter(c,b):this.addFilter(c,b)}},addFilter:function(a,b){if(!_.isEmpty(a)&&!_.isEmpty(b)){var c=this.get(a);_.indexOf(c,b)>0||this.set(a,c.concat([b]))}},removeFilter:function(a,b){if(!_.isEmpty(a)&&!_.isEmpty(b)){var c=this.get(a),d=_.indexOf(c,b);d<0||this.set(a,c.slice(0,d).concat(c.slice(d+1)))}}}),e.ViewModel=a.Model.extend({defaults:{props:new e.Props,state:new e.State,filters:new e.Filters,pagination:new c.PaginationModel,resultsPerPage:9},initialize:function(){this.props=this.get("props"),this.state=this.get("state"),this.filters=this.get("filters"),this.pagination=this.get("pagination"),this.initBrands(this.props.get("brands")),this.initCategories(this.props.get("categories")),this.filters.on("change",_.debounce(function(){this.applyFilters()},300),this),this.pagination.onChangeCurrentPage(_.debounce(function(){this.applyFilters()},300),this),this.pagination.setCurrentPage(1)},initBrands:function(a){this.state.set("brands",this.formatBrands(a)),this.filters.set("brands",_.map(a,function(a){return a.Name}))},initCategories:function(a){this.state.set("categories",this.formatCategories(a)),this.filters.set("categories",_.map(a,function(a){return a.Name}))},formatBrands:function(a){if(_.isEmpty(a))return[];var b=_.clone(a).sort(function(a,b){return a.Nameb.Name?1:0});return _.groupBy(b,function(a){return a.Name.charAt(0).toLowerCase()})},formatCategories:function(a){return _.isEmpty(a)?[]:_.clone(a).sort(function(a,b){return a.Nameb.Name?1:0})},applyFilters:function(){var a=this.props.get("products"),b=this.filters.get("brands"),c=this.filterProductsByBrands(a,b),d=this.filters.get("categories");c=this.filterProductsByCategories(c,d);var e=this.get("resultsPerPage");this.updatePaginationPagesByProductList(c,e);var f=this.pagination.getCurrentPage();c=this.filterProductsByPageNumber(c,f,e),this.state.set("products",c),this.trigger("products:updated")},filterProductsByBrands:function(a,b){return _.isEmpty(a)?[]:_.filter(a,function(a){return _.some(b,function(b){return a.brand===b})})},filterProductsByCategories:function(a,b){return _.isEmpty(a)?[]:_.filter(a,function(a){return _.some(b,function(b){return _.some(a.categories,function(a){return a===b})})})},filterProductsByPageNumber:function(a,b,c){if(_.isEmpty(a))return[];if(!_.isNumber(b)||b<0)throw new Error("Page Number cannot be invalid.");if(!_.isNumber(c)||c<0)throw new Error("Results Per Page cannot be invalid.");var d=(b-1)*c;return a.slice(d,d+c)},updatePaginationPagesByProductList:function(a,b){if(!_.isArray(a))throw new Error("Products cannot be invalid.");if(!_.isNumber(b)||b<0)throw new Error("Results Per Page cannot be invalid.");var c=Math.ceil(a.length/b);this.pagination.setNumberOfPages(c),this.pagination.getCurrentPage()>c&&this.pagination.setCurrentPage(1)}}),e.View=a.View.extend({initialize:function(a){var b={srhtype:"products",event_label:"custom-product-list",selectors:{header_container:"[data-md-cpl-header-container]",brands_container:"[data-md-cpl-brands-container]",categories_container:"[data-md-cpl-categories-container]",products_container:"[data-md-cpl-products-container]",footer_container:"[data-md-cpl-footer-container]",checkbox:"[data-srh-checkbox]"},attributes:{categories_filter_label:"md-cpl-categories-filter-label",filter_type:"srh-flt-type",goto_page:"goto-page",checkbox:"srh-checkbox"},classes:{filters_container_collapsed:"flt-collapsed",checkbox_checked:"flt-lst-checked"},templates:{header:_.template($("#SrhTemplHeader").html()),brand_filters:_.template($("#SrhTemplBrandFlt").html()),generic_filters:_.template($("#SrhTemplChbx").html()),products:_.template($("#SrhTemplContProducts").html()),footer:_.template($("#SrhTemplFooter").html())}};this.options=$.extend(!0,b,a||{}),this.$header_container=$(this.options.selectors.header_container),this.$brands_container=$(this.options.selectors.brands_container),this.$categories_container=$(this.options.selectors.categories_container),this.$products_container=$(this.options.selectors.products_container),this.$footer_container=$(this.options.selectors.footer_container),this.props=this.model.get("props"),this.state=this.model.get("state"),this.filters=this.model.get("filters"),this.pagination=this.model.get("pagination"),this.listenTo(this.model,"products:updated",this.render),this.initBrandFilters(),this.initCategoryFilters(),this.render()},events:{"click [data-goto-page]":"clickGoToPage","click [data-srh-checkbox]":"toggleFilterItem","click [data-srh-title]":"toggleFilterContainer","click [data-srh-clear-all]":"clickClearAll","click [data-srh-select-all]":"clickSelectAll"},render:function(){var a=this.state.get("products"),b=this.model.filterProductsByCategories(this.model.filterProductsByBrands(this.props.get("products"),this.filters.get("brands")),this.filters.get("categories")),c={srhtype:this.options.srhtype,current_page:this.pagination.getCurrentPage(),num_pages:this.pagination.getNumberOfPages(),per_page:this.model.get("resultsPerPage"),total_result_count:b.length,results:a,event_label:this.options.event_label};this.$header_container.html(this.options.templates.header({templData:c})),this.$products_container.html(this.options.templates.products({templData:c})),this.$footer_container.html(this.options.templates.footer({templData:c}))},initBrandFilters:function(){var a=this.state.get("brands"),b={groupedBrands:a,numBrands:a.length};this.$brands_container.html(this.options.templates.brand_filters({templData:b})),this.BrandsFilterComponent=new c.CollapsibleButtonList({$container:this.$brands_container})},initCategoryFilters:function(){var a=this.state.get("categories"),b={filterByName:this.$categories_container.data(this.options.attributes.categories_filter_label),prefix:f.categories,results:a};this.$categories_container.html(this.options.templates.generic_filters({specTempData:b})),this.CategoriesFilterComponent=new c.CollapsibleButtonList({$container:this.$categories_container})},clickGoToPage:function(a){a.preventDefault();var b=$(a.currentTarget).data(this.options.attributes.goto_page);_.isNumber(b)&&(this.pagination.setCurrentPage(b),this.scrollToTop())},toggleFilterItem:function(a){a.preventDefault();var b=$(a.currentTarget),c=b.data(this.options.attributes.filter_type),d=b.data(this.options.attributes.checkbox);this.filters.toggleFilter(c,d),b.toggleClass(this.options.classes.checkbox_checked)},toggleFilterContainer:function(a){$(a.currentTarget).parent().toggleClass(this.options.classes.filters_container_collapsed)},clickClearAll:function(a){a.preventDefault();var b=$(a.target);this.modifyAllFilters($(a.target),_.bind(this.filters.removeFilter,this.filters)),b.parent().find(this.options.selectors.checkbox).removeClass(this.options.classes.checkbox_checked)},clickSelectAll:function(a){a.preventDefault();var b=$(a.target);this.modifyAllFilters(b,_.bind(this.filters.addFilter,this.filters)),b.parent().find(this.options.selectors.checkbox).addClass(this.options.classes.checkbox_checked)},modifyAllFilters:function(a,b){var c=a.data(this.options.attributes.filter_type),d=_.invert(f)[c],e=_.pluck(this.props.get(d),"Name");_.each(e,function(a){b(d,a)})},scrollToTop:function(){var a=this.$el.offset().top-50;document.body.scrollTop-1&&(b.preventDefault(),p.navigate(c.substr(c.indexOf("locations"))),i.scrollTo$ElementAsync(a,this.config.scroll_duration_ms))},this)),p.on("route:locations",function(b){if(b&&c.indexOf(n,b)>-1)this._renderListing(b);else{if(b)return void p.navigate("locations",{trigger:!0});this._renderListing((m.val()||"").toLowerCase())}i.scrollTo$ElementAsync(a,this.config.scroll_duration_ms)},this),p.on("route:default",function(){this._renderListing((m.val()||"").toLowerCase())},this),d.history.start({pushState:!0,root:i.getShortLanguageCode()+f.router_root})):this._renderListing((m.val()||"").toLowerCase())},k.prototype._renderListing=function(a){var d=this.stores_by_city_by_province_key[a]||[],e=c.keys(d).sort();b(this.config.selectors.list_container,this.$el).html(this.listing_template({cities:e,stores_by_city:d,num_total_stores:Array.prototype.concat.apply([],c.values(d)).length,language_code:i.getShortLanguageCode()}))}}(this),function(a,b){"use strict";var c=b(a),d=NR.resolve("SDM.Util"),e=NR.resolve("SDM.Core.Modules"),f=NR.resolve("SDM.Core.Components.VideoPanelDeeplink"),g=a.SDM||(a.SDM={}),h=g.GlobalTileGridData||(g.GlobalTileGridData={}),i=e.GlobalTileGrid=function(a,c){h.GlobalTiles||console.error(new Error("Missing GlobalTileGridData")),this.tileData=h.GlobalTiles.shift(),this.tileRow=h.InitialLoadRowCount.shift(),this.tileTemplateId=h.TileTemplateIds.shift(),this.isNavIncluded="True"===h.IsNavIncluded.shift(),c=c||{};var d={$el:a,tiles_per_load_desktop:3,tiles_per_load_tablet:2,tiles_per_load_mobile:3,tiles:[],isLastWindowDesktop:!1,selectors:{tiles_template:this.tileTemplateId,tiles_container:"[data-tiles-container]",load_more_button:"[data-load-more-button]"}},e=b.extend(!0,{},d,c);this._init(e)};i.prototype._init=function(a){this.config=a,this.template=_.template(b(a.selectors.tiles_template).html()),this.videoPanels=_.reduce(_.filter(this.tileData,function(a){return"video"===a.Type}),function(a,b){return a[b.ID]=b,a},{}),c.on("becometonarrow becometowide becometosmalldesktopwide becometoextrawide",{config:a},_.bind(this._resetGrid,this)),b(".wg-gt__tile-video-modal-popup, .wg-gt__tile-video-modal-close-button",this.config.$el).click(_.bind(this._onModalClick,this)),this.config.$el.on("click",".wg-gt__tile-video-detail-play",_.bind(function(a){var c=b(a.target).closest(".wg-gt__tile-video-detail"),d=c.data("wg-vp-video-player-id");if(history.pushState){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+"?v="+encodeURIComponent(d);window.history.pushState({path:e},"",e)}this._showVideo(d)},this)),this.config.$el.on("keydown",".wg-gt__tile-video-detail-play",_.bind(function(a){if(13===a.keyCode){var c=b(a.target).closest(".wg-gt__tile-video-detail"),d=c.data("wg-vp-video-player-id");if(history.pushState){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+"?v="+encodeURIComponent(d);window.history.pushState({path:e},"",e)}this._showVideo(d)}},this)),this.isNavIncluded&&this.config.$el.on("click",".md-gtg__tile-list-hamburger",_.bind(function(){this.config.$el.find(".md-gtg__tile-list-hamburger").toggleClass("md-gtg__tile-list-hamburger--active")},this)),window.onpopstate=_.bind(function(){var a=new URLSearchParams(window.location.search),b=a.get("v");b?this._showVideo(b):this.currentVideoPanel&&(this.currentVideoPanel._hide(!0),this.currentVideoPanel=null)},this);var d=new URLSearchParams(window.location.search),e=d.get("v");e&&this._showVideo(e)},i.prototype._resetGrid=function(){var a=d.isWindowSmallDesktopWide()||d.isWindowExtraWide();if(!a||!this.config.isLastWindowDesktop){this.config.isLastWindowDesktop=a;var c=d.isWindowNarrow();this.config.$el.find(this.config.selectors.tiles_container).empty();var e=0;e=c?this.tileRow*this.config.tiles_per_load_mobile:d.isWindowWide()?this.tileRow*this.config.tiles_per_load_tablet:this.tileRow*this.config.tiles_per_load_desktop;var f=this.isNavIncluded&&a?1:0;this.pagedTiles=_.reduce(this.tileData,function(a,b){if(c&&b.HideMobile)return a;var d=!c&&b.DoubleTile?2:1;return f+=d,f>e&&(f=d,a.push([])),a[a.length-1].push(b),a},[[]]);var g=0;0===this.tileRow?g=this.tileData.length:this.config.$el.find(this.config.selectors.load_more_button).off("click").click(function(){this._renderPage(g+=1)}.bind(this)),b(document.body).css({position:"",top:"",width:""}),window.scrollTo(0,this.modalScrollY),this._renderPage(g),this.isNavIncluded&&(d.isWindowNarrow()||d.isWindowWide()?b("#Body").css("padding-top",b(".md-gtg__tile-list-links")[0].clientHeight):b("#Body").css("padding-top",""))}},i.prototype._renderPage=function(a){for(var b=[],c=0;c<=a;c++)b=b.concat(this.pagedTiles[c]);this.config.$el.find(this.config.selectors.load_more_button).toggleClass("md-gtg__load-more-button--hidden",!this.pagedTiles[a+1]),this.config.$el.find(this.config.selectors.tiles_container).html(this.template({tiles:b}))},i.prototype._showVideo=function(a){if(a&&this.videoPanels[a]){ this.currentVideoPanel=new f({$modalContainer:b(document).find("[data-wg-gt-tile-video-modal]"),$container:this.videoPanels[a],$closeButtonContainer:b(document).find("[data-wg-gt-tile-video-modal-close-button]")});var c=document.querySelector(".wg-gt__tile-video-modal-container");this.modalScrollY=window.scrollY,c.velocity({top:"0%"},500,[210,19]),setTimeout(function(){b(document.body).css("top","-"+this.modalScrollY+"px"),b(document.body).css("position","fixed"),b(document.body).css("width","100%")},0),setTimeout(function(){var a=c.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]'),b=a[0],d=a[a.length-1];c.addEventListener("keydown",function(a){("Tab"===a.key||9===a.keyCode)&&(a.shiftKey?document.activeElement===b&&(d.focus(),a.preventDefault()):document.activeElement===d&&(b.focus(),a.preventDefault()))}),b.focus()},1e3)}},i.prototype._onModalClick=function(a){a.stopPropagation(),a.preventDefault(),this.currentVideoPanel._hide(!1),this.currentVideoPanel=null}}(this,jQuery),function(a,b){var c=NR.resolve("SDM.Core.Modules"),d=NR.resolve("SDM.ArticleContentGridData"),e=NR.resolve("SDM.Core.Components.VideoPanel"),f=NR.resolve("SDM.Core.Components"),g=f.SliderCarousel,h=c.ArticleContentGrid=function(a,c){c=c||{};for(var e={$el:a},f=d.RelatedArticlesJSON,g=d.RelatedArticlesUrlsJSON,h=0;h-1?a.config.selectedFilters.splice(c,1):a.config.selectedFilters.push(b(this).val())}a._getStores()}),b(".md-fsf__filter-clear-button").on("click",function(){b(".md-fsf__filters-container").addClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").addClass("wg-fsfb__search-form--disabled"),b(".md-fsf__filter-checkbox").prop("checked",!1),a.config.selectedFilters=[],a.config.walkinsFilter=!1,a._getStores()})},n.prototype._initPopUps=function(){var a=b(this.config.$el.find(this.config.selectors.storeNotificationPopUp));this.config.storeNotificationPopUp=new f.PopUp(a);var c=b(this.config.$el.find(this.config.selectors.storeReminderPopUp));this.config.storeReminderPopUp=new f.PopUp(c),this.config.elements.$storeNotificationBack=this.config.$el.find(this.config.selectors.storeNotificationButtonBack),this.config.elements.$storeNotificationBack.on("click",_.bind(this._onStoreNotificationBack,this))},n.prototype._queryMap=function(a){this.geocoder.geocode({address:a},_.bind(this._geocoderCallback,this))},n.prototype._geocoderCallback=function(c,d){d===a.google.maps.GeocoderStatus.OK?(this.config.$el.find(this.config.selectors.searchError).css("display","none"),this.config.$el.find(this.config.selectors.searchInput).attr("aria-invalid",!1),this.config.$el.find(this.config.selectors.storeListSearchError).hide(),b("#md-fsf__filters-button").prop("disabled",!1),this.query_location=c[0].geometry.location,this.map.setCenter(this.query_location),this._getStores()):(b("#md-fsf__store-list-error-msg--pre-search").hide(),b("#md-fsf__store-list-error-msg").show(),this.config.$el.find(this.config.selectors.searchError).css("display","block"),this.config.$el.find(this.config.selectors.searchInput).attr("aria-invalid",!0),this.config.$el.find(this.config.selectors.storeListSearchError).show(),b("#md-fsf__filters-button").prop("disabled",!0),b(".md-fsf__filters-container").removeClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").removeClass("wg-fsfb__search-form--disabled"),this._renderStoreList([]))},n.prototype._getStores=function(){google.maps.event.removeListener(this.zoomChangedListener),google.maps.event.removeListener(this.dragEndListener),b(".md-fsf__filters-container").addClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").addClass("wg-fsfb__search-form--disabled"),this._clearAllMarkers(),this.config.$el.find(this.config.selectors.finderLoading).addClass(this.config.classes.loadingVisible);var a={fluShotTypes:this.config.selectedFilters.join(","),lang:g.getShortLanguageCode(),lat:this.query_location.lat(),lng:this.query_location.lng(),minLat:this.map.getBounds().getSouthWest().lat(),minLng:this.map.getBounds().getSouthWest().lng(),maxLat:this.map.getBounds().getNorthEast().lat(),maxLng:this.map.getBounds().getNorthEast().lng(),walkin:this.config.walkinsFilter};b.ajax({method:"GET",url:"/sdmapi/store/GetFluShotStores",data:a}).done(_.bind(function(a){if(a){this.config.storeHoursPopUps={},this.config.$el.find(this.config.selectors.finderLoading).removeClass(this.config.classes.loadingVisible),this._renderStoreList(a),this._addMarkerToMap(a),this._initStorePopUp(a);var c=this;this.dragEndListener=google.maps.event.addListenerOnce(this.map,"dragend",function(){c.dragEndListener=google.maps.event.addListenerOnce(c.map,"idle",function(){c._getStores()})}),this.zoomChangedListener=google.maps.event.addListenerOnce(this.map,"zoom_changed",function(){c._getStores()}),b(".md-fsf__filters-container").removeClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").removeClass("wg-fsfb__search-form--disabled")}},this)).fail(function(a){console.log(a)})},n.prototype._addMarkerToMap=function(a){if(0!==a.length){this.bounds=new google.maps.LatLngBounds;for(var c=_.template(b(this.config.templates.storeInfo).html()),d=0;d0?e.storeUrl="https://stores.shoppersdrugmart.ca/"+g.getShortLanguageCode()+"/store/"+e.StoreID:e.storeUrl="https://stores.pharmaprix.ca/"+g.getShortLanguageCode()+"/store/"+e.StoreID;var f=d+1,h="",i={};e.VaccineAvailable?(h="/static/core/images/covid-shot-available-pin.png",i={text:String(f),fontSize:"16px",fontWeight:"bold",color:"white"}):(h="/static/core/images/covid-shot-unavailable-pin.png",i={text:String(f),fontSize:"16px",fontWeight:"bold",color:"black"});var l=k+" "+(d+1),m=new google.maps.Marker({position:{lat:e.Latitude,lng:e.Longitude},map:this.map,label:i,icon:{url:h,scaledSize:new google.maps.Size(24.5,35.5),labelOrigin:new google.maps.Point(12,15)},title:l});this.markers.push(m);var n=new google.maps.InfoWindow({content:c({store:e,storeNotificationStores:this.config.storeNotificationStores,notifyMeIconDisplayPerProvince:j})});m.addListener("click",_.bind(this._openInfoWindow,this,n,this.map,m))}}},n.prototype._openInfoWindow=function(a,b,c){this.lastInfoWindow&&this.lastInfoWindow.close(),a.open(b,c),this.lastInfoWindow=a,google.maps.event.addListener(a,"domready",_.bind(this._initInfoWindow,this))},n.prototype._initInfoWindow=function(){var a=b(this.config.$el.find(this.config.selectors.storeInfoStoreHours)),c=b(a.closest(this.config.selectors.storeInfoStore));this.config.tempStoreId=c.data(this.config.data.storeInfoStoreId);var d=c.find(this.config.selectors.storeInfoStoreNotification),e=c.find(this.config.selectors.storeInfoStoreReminder);this._updateStoreInfoStoreNotificationButton(),d.unbind("click").on("click",_.bind(this._renderStoreNotification,this)),e.unbind("click").on("click",_.bind(this._renderStoreReminder,this,this.config.tempStoreId))},n.prototype._clearAllMarkers=function(){for(var a=0;a0){this.config.$el.find(this.config.selectors.searchError).css("display","none"),this.config.$el.find(this.config.selectors.searchInput).attr("aria-invalid",!1),this.config.$el.find(this.config.selectors.storeListSearchError).hide(),b("#md-fsf__filters-button").prop("disabled",!1);for(var c=0;a.length>c;c++)window.location.host.search("shoppersdrugmart")>0?a[c].storeUrl="https://stores.shoppersdrugmart.ca/"+g.getShortLanguageCode()+"/store/"+a[c].StoreID:a[c].storeUrl="https://stores.pharmaprix.ca/"+g.getShortLanguageCode()+"/store/"+a[c].StoreID;this.config.$el.find(this.config.selectors.storeList).removeClass(this.config.classes.storeListCollapse);var d=_.template(b(this.config.templates.storeList).html());this.config.storeListData=a;var e={storeList:a,notifyMeIconDisplayPerProvince:j,storeNotificationStores:this.config.storeNotificationStores};this.config.$el.find(this.config.selectors.storeList).html(d(e)),this.config.$el.find(this.config.selectors.storeIconNotificationButton).on("click",_.bind(this._onStoreIconNotificationButtonClick,this)),this.config.$el.find(this.config.selectors.storeConsentFormButton).on("click",_.bind(this._onStoreConsentFormButtonClick,this)),this.config.$el.find(this.config.selectors.storeProvincialBookingButton).on("click",_.bind(this._onStoreprovincialBookingButtonClick,this))}else this.config.$el.find(this.config.selectors.storeList).addClass(this.config.classes.storeListCollapse),this.config.$el.find(this.config.selectors.searchError).css("display","block"),this.config.$el.find(this.config.selectors.searchInput).attr("aria-invalid",!0),this.config.$el.find(this.config.selectors.storeListSearchError).show(),b("#md-fsf__filters-button").prop("disabled",!0)},n.prototype._onStoreIconNotificationButtonClick=function(a){var c=b(b(a.currentTarget).closest(this.config.selectors.store));this.config.tempStoreId=c.data(this.config.data.storeId),this.config.selectedStoresArray.length<3&&-1===this.config.selectedStoresArray.indexOf(this.config.tempStoreId)&&(this.config.selectedStoresArray.push(this.config.tempStoreId),b(".md-fsf__store-icon-notification-item--pilot-notify-a").css("display","none"),b(".md-fsf__store-icon-notification-item--pilot-notify-b").css("display","flex"),b(a.currentTarget).addClass(this.config.classes.storeIconNotificationButtonEdit)),this._renderStoreNotification()},n.prototype._updateStoreInfoStoreNotificationButton=function(){var a=this.config.$el.find(this.config.selectors.storeInfoStore),b=a.data(this.config.data.storeInfoStoreId),c=a.find(this.config.selectors.storeInfoStoreNotification);this.config.storeNotificationStores[b]?c.addClass(this.config.classes.storeIconNotificationButtonEdit):c.removeClass(this.config.classes.storeIconNotificationButtonEdit)},n.prototype._renderStoreNotification=function(){var a=!1;delete this.config.storeNotificationStores[""],Object.keys(this.config.storeNotificationStores).length<3?this.config.storeNotificationStores[this.config.tempStoreId]=this.config.stores[this.config.tempStoreId]:this.config.storeNotificationStores[this.config.tempStoreId]||(a=!0),this.config.storeNotificationPopUp._showModal();var c=_.template(b(this.config.templates.storeNotification).html());this.config.storeNotificationStores[""]="",delete this.config.storeNotificationStores[""];var d={stores:this.config.storeNotificationStores,showStoreNotificationAddStoreError:a};this.config.$el.find(this.config.selectors.storeNotification).html(c(d)),this._initStoreNotification()},n.prototype._updateStoreNotificationButton=function(a){b(this.config.$el.find("[data-"+this.config.data.storeId+"="+a+"]")).find(this.config.selectors.storeIconNotificationButton).addClass(this.config.classes.storeIconNotificationButtonEdit),this._updateStoreInfoStoreNotificationButton()},n.prototype._getStoreListConsentForm=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=i[a[c].province];if(!d)continue;b[a[c].province]=d}return b},n.prototype._initStoreNotification=function(){this.config.elements.$storeNotification=this.config.$el.find(this.config.selectors.storeNotification),this.config.elements.$storeNotificationSteps=this.config.elements.$storeNotification.find("[data-"+this.config.data.storeNotificationStep+"]"),this.config.elements.$storeNotificationNext=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationButtonNext),this.config.elements.$storeNotificationSkip=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationButtonSkip),this.config.elements.$storeNotificationSubmit=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationButtonSubmit),this.config.elements.$storeNotificationShotTypeHigh=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationShotTypeHigh),this.config.elements.$storeNotificationShotTypeRegular=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationShotTypeRegular),this.config.elements.$storeNotificationEmailInput=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEmailInput),this.config.elements.$storeNotificationSmsInput=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationSmsInput),this.config.elements.$storeNotificationSmsCheckbox=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationSmsCheckbox),this.config.elements.$storeNotificationEmailInputError=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEmailInputError),this.config.elements.$storeNotificationSmsInputError=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationSmsInputError),this.config.elements.$storeNotificationEmailCheckbox=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEmailCheckbox),this.config.elements.$storeNotificationEmailRadio=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEmailRadio),this.config.elements.$storeNotificationSmsRadio=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationSmsRadio),this.config.elements.$storeNotificationEmailConfirmation=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEmailConfirmation),this.config.elements.$storeNotificationSmsConfirmation=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationSmsConfirmation),this.config.elements.$storeNotificationRemove=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationStoreRemove),this.config.elements.$storeNotificationAddStore=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationAddStore),this.config.elements.$storeNotificationAddStoreError=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationAddStoreError),this.config.elements.$storeNotificationSubmitError=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationSubmitError),this.config.elements.$storeNotificationEditStore=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEditStore),this.config.elements.$storeNotificationEmailEdit=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationEmailEdit),this.config.elements.$storeNotificationTypesEdit=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationTypesEdit),this.config.elements.$storeNotificationTypesEdit=this.config.elements.$storeNotification.find(this.config.selectors.storeNotificationTypesEdit),this.config.storeNotificationActiveStep=1,this.config.activeStep=0,this.config.elements.$storeNotificationBack.addClass(this.config.classes.storeNotificationButtonCollapse),this.config.elements.$storeNotificationNext.removeClass(this.config.classes.storeNotificationButtonCollapse);for(var a=1;a<=this.config.elements.$storeNotificationSteps.length;a++)this.config.elements.$storeNotificationStep=b(this.config.elements.$storeNotification.find("[data-"+this.config.data.storeNotificationStep+"="+a+"]")),1===a?this.config.elements.$storeNotificationStep.removeClass(this.config.classes.storeNotificationStepCollapse):this.config.elements.$storeNotificationStep.addClass(this.config.classes.storeNotificationStepCollapse);var c=this;document.querySelector("#email").addEventListener("change",function(){c.config.storeNotificationEmailChecked=this.checked,c.config.storeNotificationPhoneNumberChecked=!1,document.querySelector("#md-fsf__store-notification-email-checkbox-consent").classList.add("active"),document.querySelector("#md-fsf__store-notification-sms-checkbox-consent").classList.remove("active"),document.querySelector("[data-md-fsf-store-notification-sms-checkbox]").checked=!1,c.config.elements.$storeNotificationSmsInput.prop("disabled",!0),c.config.elements.$storeNotificationEmailInput.prop("disabled",!1),b("#md-fsf__store-notification-email-input-consent").show(),b("#md-fsf__store-notification-sms-input-consent").hide(),b("#md-fsf__store-notification-email-disclaimer").show(),b("#md-fsf__store-notification-sms-disclaimer").hide(),c._onDisplayStep3()}),document.querySelector("#sms").addEventListener("change",function(){c.config.storeNotificationPhoneNumberChecked=this.checked,c.config.storeNotificationEmailChecked=!1,document.querySelector("[data-md-fsf-store-notification-email-checkbox]").checked=!1,document.querySelector("#md-fsf__store-notification-email-checkbox-consent").classList.remove("active"),document.querySelector("#md-fsf__store-notification-sms-checkbox-consent").classList.add("active"),c.config.elements.$storeNotificationSmsInput.prop("disabled",!1),c.config.elements.$storeNotificationEmailInput.prop("disabled",!0),b("#md-fsf__store-notification-email-input-consent").hide(),b("#md-fsf__store-notification-sms-input-consent").show(),b("#md-fsf__store-notification-email-disclaimer").hide(),b("#md-fsf__store-notification-sms-disclaimer").show(),c._onDisplayStep3()}),document.querySelector("#shot-type-high").addEventListener("change",function(){c.config.storeNotificationFluShotTypeHigh=this.checked,c._onDisplayStep2()}),document.querySelector("#shot-type-regular").addEventListener("change",function(){c.config.storeNotificationFluShotTypeRegular=this.checked,c._onDisplayStep2()}),document.querySelector("#md-fsf__store-notification-shot-type-remove-button--high").addEventListener("click",function(){b("#md-fsf__store-notification-shot-type-confirmation--high").hide(),b("#md-fsf__store-notification-shot-type-remove-button--high").hide(),b("#md-fsf__store-notification-shot-type-remove-button--regular").hide(),c.config.storeNotificationFluShotTypeHigh=!1}),document.querySelector("#md-fsf__store-notification-shot-type-remove-button--regular").addEventListener("click",function(){b("#md-fsf__store-notification-shot-type-confirmation--regular").hide(),b("#md-fsf__store-notification-shot-type-remove-button--high").hide(),b("#md-fsf__store-notification-shot-type-remove-button--regular").hide(),c.config.storeNotificationFluShotTypeRegular=!1}),this.config.$el.find(".wg-pu__content-container").on("keydown",_.bind(this._onKeyDown,this)),this.config.elements.$storeNotificationNext.on("click",_.bind(this._onStoreNotificationNext,this)),this.config.elements.$storeNotificationSubmit.on("click",_.bind(this._onStoreNotificationSubmit,this)),this.config.elements.$storeNotificationRemove.on("click",_.bind(this._onStoreNotificationStoreRemove,this)),this.config.elements.$storeNotificationAddStore.on("click",_.bind(this.config.storeNotificationPopUp._hideModal,this.config.storeNotificationPopUp)),this.config.elements.$storeNotificationEditStore.on("click",_.bind(this._onStoreNotificationStoreEdit,this)),this.config.elements.$storeNotificationEmailEdit.on("click",_.bind(this._onStoreNotificationBack,this)),this.config.elements.$storeNotificationTypesEdit.on("click",_.bind(this._onStoreNotificationTypesEdit,this)),this._onDisplayStep1()},n.prototype._onStoreNotificationNext=function(a){if(this.config.storeNotificationActiveStep!==this.config.elements.$storeNotificationSteps.length){if(3===this.config.storeNotificationActiveStep){var b=/^(([abcdefg.hijklmnopqrstuvwxyz!#$%&'*/=?^_+-`{|}~0123456789]+))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(this.config.elements.$storeNotificationEmailRadio[0].checked){if(0===this.config.elements.$storeNotificationEmailInput[0].value.length||!b.test(this.config.elements.$storeNotificationEmailInput[0].value))return this.config.elements.$storeNotificationEmailInputError.show(),this.config.elements.$storeNotificationSmsInputError.hide(),void this.config.elements.$storeNotificationEmailInput.focus();this.config.storeNotificationEmail=this.config.elements.$storeNotificationEmailInput[0].value,this.config.storeNotificationEmailConsent=this.config.elements.$storeNotificationEmailCheckbox[0].checked,this.config.storeNotificationPhoneNumber="",this.config.storeNotificationSmsConsent=!1,this.config.storeNotificationEmailRadioChecked=!0, this.config.storeNotificationSmsRadioChecked=!1,this._notificationStepForward()}else{if(0===this.config.elements.$storeNotificationSmsInput[0].value.length||null===this.config.elements.$storeNotificationSmsInput[0].value.match(/^[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}$/im))return this.config.elements.$storeNotificationEmailInputError.hide(),this.config.elements.$storeNotificationSmsInputError.show(),void this.config.elements.$storeNotificationSmsInput.focus();this.config.storeNotificationPhoneNumber=this.config.elements.$storeNotificationSmsInput[0].value,this.config.storeNotificationSmsConsent=this.config.elements.$storeNotificationSmsCheckbox[0].checked,this.config.storeNotificationEmail="",this.config.storeNotificationEmailConsent=!1,this.config.storeNotificationEmailRadioChecked=!1,this.config.storeNotificationSmsRadioChecked=!0,this._notificationStepForward()}}else this._notificationStepForward();1===this.config.storeNotificationActiveStep?this._onDisplayStep1():2===this.config.storeNotificationActiveStep?this._onDisplayStep2():3===this.config.storeNotificationActiveStep?this._onDisplayStep3():4===this.config.storeNotificationActiveStep&&this._onDisplayStep4(),a.preventDefault()}},n.prototype._onStoreNotificationBack=function(a){1!==this.config.storeNotificationActiveStep&&(b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).addClass(this.config.classes.storeNotificationStepCollapse),this.config.storeNotificationActiveStep--,b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).removeClass(this.config.classes.storeNotificationStepCollapse),1===this.config.storeNotificationActiveStep?this._onDisplayStep1():2===this.config.storeNotificationActiveStep?this._onDisplayStep2():3===this.config.storeNotificationActiveStep?this._onDisplayStep3():4===this.config.storeNotificationActiveStep&&this._onDisplayStep4(),a.preventDefault())},n.prototype._onStoreNotificationStoreEdit=function(){b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).addClass(this.config.classes.storeNotificationStepCollapse),this.config.storeNotificationActiveStep=1,b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).removeClass(this.config.classes.storeNotificationStepCollapse),this.config.activeStep=0,this._onDisplayStep1()},n.prototype._onStoreNotificationTypesEdit=function(){b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).addClass(this.config.classes.storeNotificationStepCollapse),this.config.storeNotificationActiveStep=2,b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).removeClass(this.config.classes.storeNotificationStepCollapse)},n.prototype._notificationStepForward=function(){b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).addClass(this.config.classes.storeNotificationStepCollapse),this.config.storeNotificationActiveStep++,b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).removeClass(this.config.classes.storeNotificationStepCollapse)},n.prototype._onDisplayStep1=function(){this.config.elements.$storeNotificationBack.addClass(this.config.classes.storeNotificationButtonCollapse),b(".md-fsf__store-notification-button--next").removeClass("md-fsf__store-notification-button--disabled"),b(".md-fsf__store-notification-button--next").prop("disabled",!1),Object.keys(this.config.storeNotificationStores).length>=3?(this.config.elements.$storeNotificationAddStore.hide(),this.config.elements.$storeNotificationAddStore.prop("disabled",!0)):(this.config.elements.$storeNotificationAddStore.show(),this.config.elements.$storeNotificationAddStore.prop("disabled",!1)),0===Object.keys(this.config.storeNotificationStores).length&&(this.config.elements.$storeNotificationNext[0].disabled=!0),1!==this.config.activeStep&&(this._focusFirstElement(),this.config.activeStep=1)},n.prototype._onDisplayStep2=function(){this.config.elements.$storeNotificationBack.removeClass(this.config.classes.storeNotificationButtonCollapse),this.config.elements.$storeNotificationAddStoreError.addClass(this.config.classes.storeNotificationAddStoreErrorCollapse),document.querySelector("[data-md-fsf-store-notification-type-high-checkbox]").checked=this.config.storeNotificationFluShotTypeHigh,document.querySelector("[data-md-fsf-store-notification-type-regular-checkbox]").checked=this.config.storeNotificationFluShotTypeRegular,this.config.storeNotificationFluShotTypeHigh||this.config.storeNotificationFluShotTypeRegular?(b(".md-fsf__store-notification-button--next").removeClass("md-fsf__store-notification-button--disabled"),b(".md-fsf__store-notification-button--next").prop("disabled",!1)):(b(".md-fsf__store-notification-button--next").addClass("md-fsf__store-notification-button--disabled"),b(".md-fsf__store-notification-button--next").prop("disabled",!0)),Object.size=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c};var a=Object.size(this.config.storeNotificationStores);b("#md-fsf__store-notification-stores-selected-count--step-2").html(a),2!==this.config.activeStep&&(this._focusFirstElement(),this.config.activeStep=2)},n.prototype._onDisplayStep3=function(){this.config.elements.$storeNotificationEmailInputError.hide(),this.config.elements.$storeNotificationSmsInputError.hide(),this.config.elements.$storeNotificationSmsRadio.checked=this.config.storeNotificationSmsRadioChecked,this.config.elements.$storeNotificationEmailRadio.checked=this.config.storeNotificationEmailRadioChecked,this.config.storeNotificationEmailRadioChecked?this.config.elements.$storeNotificationEmailInput[0].value=this.config.storeNotificationEmail:this.config.elements.$storeNotificationSmsInput[0].value=this.config.storeNotificationPhoneNumber,this.config.storeNotificationEmailConsent&&(this.config.elements.$storeNotificationEmailCheckbox[0].checked=!0),this.config.storeNotificationSmsConsent&&(this.config.elements.$storeNotificationSmsCheckbox[0].checked=!0),Object.size=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c};var a=Object.size(this.config.storeNotificationStores);b("#md-fsf__store-notification-stores-selected-count--step-3").html(a);var c=1;this.config.storeNotificationFluShotTypeHigh&&this.config.storeNotificationFluShotTypeRegular&&(c=2),b("#md-fsf__store-notification-selected-shot-count").html(c),3!==this.config.activeStep&&(this._focusFirstElement(),this.config.activeStep=3)},n.prototype._onDisplayStep4=function(){this.config.elements.$storeNotificationSubmitError.hide(),Object.size=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c},this.config.storeNotificationFluShotTypeHigh?b("#md-fsf__store-notification-shot-type-confirmation--high").show():(b("#md-fsf__store-notification-shot-type-confirmation--high").hide(),b("#md-fsf__store-notification-shot-type-confirmation--high").prop("disabled",!0)),this.config.storeNotificationFluShotTypeRegular?b("#md-fsf__store-notification-shot-type-confirmation--regular").show():(b("#md-fsf__store-notification-shot-type-confirmation--regular").hide(),b("#md-fsf__store-notification-shot-type-confirmation--regular").prop("disabled",!0)),this.config.storeNotificationFluShotTypeRegular&&this.config.storeNotificationFluShotTypeHigh?(b("#md-fsf__store-notification-shot-type-remove-button--high").show(),b("#md-fsf__store-notification-shot-type-remove-button--regular").show()):(b("#md-fsf__store-notification-shot-type-remove-button--high").hide(),b("#md-fsf__store-notification-shot-type-remove-button--regular").hide(),b("#md-fsf__store-notification-shot-type-remove-button--high").prop("disabled",!0),b("#md-fsf__store-notification-shot-type-remove-button--regular").prop("disabled",!0)),this.config.storeNotificationEmail?(b("#md-fsf__store-notification-email-confirmation-container").show(),b("#md-fsf__store-notification-sms-confirmation-container").hide(),this.config.elements.$storeNotificationEmailConfirmation.html(this.config.storeNotificationEmail)):(b("#md-fsf__store-notification-email-confirmation-container").hide(),b("#md-fsf__store-notification-sms-confirmation-container").show(),this.config.elements.$storeNotificationSmsConfirmation.html(this.config.storeNotificationPhoneNumber)),4!==this.config.activeStep&&(this._focusFirstElement(),this.config.activeStep=4)},n.prototype._onDisplayStep5=function(){this._focusFirstElement()},n.prototype._focusFirstElement=function(){var a=this.config.$el.find(".md-fsf__store-notification-step--"+this.config.storeNotificationActiveStep),b=a.find(this.config.focusableElements),c=a.find(b)[0];setTimeout(function(){c.focus()}.bind(this),600)},n.prototype._onKeyDown=function(){if("Tab"===event.key||9===event.keyCode){var a=this.config.$el.find(".md-fsf__store-notification-step--"+this.config.storeNotificationActiveStep),b=a.find(this.config.focusableElements);1!==this.config.storeNotificationActiveStep&&b.push(document.querySelector(".wg-pu__content-container").querySelector(".md-fsf__store-notification-button--back")),b.push(document.querySelector(".wg-pu__content-container").querySelector(".wg-pu__close-button"));var c=a.find(b)[0],d=b[b.length-1];event.shiftKey?document.activeElement===c&&(d.focus(),event.preventDefault()):document.activeElement===d&&(c.focus(),event.preventDefault())}},n.prototype._onStoreNotificationSubmit=function(){Object.size=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c},this.config.elements.$storeNotificationBack.addClass(this.config.classes.storeNotificationButtonCollapse);var a=b(this.config.$el.find(this.config.selectors.storeNotification)),c=b(a.find(this.config.selectors.storeNotificationButtonBack)),d=b(a.find(this.config.selectors.storeNotificationButtonSubmit)),e=b(this.config.$el.find(this.config.selectors.storeNotificationSubmitError)),f=a.find(this.config.selectors.storeNotificationEmailRadio),i=a.find(this.config.selectors.storeNotificationSmsRadio);e.hide(),a.find(this.config.selectors.storeNotificationLoading).addClass(this.config.classes.loadingVisible);var j=Object.keys(this.config.storeNotificationStores),k={SubscriberKey:l,Email:this.config.storeNotificationEmail,LangCode:g.getFullLanguageCode(),Phone:this.config.storeNotificationPhoneNumber,StoreA:j[0]?j[0]:"",StoreB:j[1]?j[1]:"",StoreC:j[2]?j[2]:"",EmailFluOptIn:f[0].checked,SmsFluOptIn:i[0].checked,EmailPromoOptIn:this.config.storeNotificationEmailConsent,SmsPromoOptIn:this.config.storeNotificationSmsConsent,FluShotRegular:this.config.storeNotificationFluShotTypeRegular,FluShotHighDose:this.config.storeNotificationFluShotTypeHigh};b.ajax({type:"POST",url:this.config.storeNotificationSubmitUrl,contentType:"application/json",data:JSON.stringify(k),headers:{__RequestVerificationToken:h}}).done(_.bind(function(f){if(a.find(this.config.selectors.storeNotificationLoading).removeClass(this.config.classes.loadingVisible),"OK"!==f.Status)return void e.show();f.Updated?(b("#md-fsf__store-notification-header-success").hide(),b("#md-fsf__store-notification-header-resubmission").show()):(b("#md-fsf__store-notification-header-success").show(),b("#md-fsf__store-notification-header-resubmission").hide()),b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).addClass(this.config.classes.storeNotificationStepCollapse),this.config.storeNotificationActiveStep+=1,b(this.config.$el.find("[data-"+this.config.data.storeNotificationStep+"="+this.config.storeNotificationActiveStep+"]")).removeClass(this.config.classes.storeNotificationStepCollapse),c.addClass(this.config.classes.storeNotificationButtonCollapse),d.addClass(this.config.classes.storeNotificationButtonCollapse),this.config.elements.$storeNotification.find("[data-md-fsf-store-notification-button-complete]").on("click",_.bind(this.config.storeNotificationPopUp._hideModal,this.config.storeNotificationPopUp)),this.config.storeNotificationStores={},this.config.selectedStoresArray=[],this.config.$el.find(this.config.selectors.storeIconNotificationButton).removeClass(this.config.classes.storeIconNotificationButtonEdit),this.config.storeNotificationEmail="",this.config.storeNotificationEmailConsent=!1,this.config.storeNotificationPhoneNumber="",this.config.storeNotificationSmsConsent=!1,this.config.storeNotificationFluShotTypeRegular=!1,this.config.storeNotificationFluShotTypeHigh=!1,b(".md-fsf__store-icon-notification-item--pilot-notify-a").css("display","flex"),b(".md-fsf__store-icon-notification-item--pilot-notify-b").css("display","none"),this._onDisplayStep5()},this))},n.prototype._onStoreNotificationStoreRemove=function(a){setTimeout(_.bind(function(){var c=b(this.config.$el.find(this.config.selectors.storeNotification)),d=b(a.currentTarget.closest(this.config.selectors.storeNotificationStore)),e=d.data(this.config.data.storeNotificationStoreId),f=c.find("[data-"+this.config.data.storeNotificationStoreId+"="+e+"]"),g=b(this.config.$el.find(this.config.selectors.storeNotificationAddStoreError));f.remove(),delete this.config.storeNotificationStores[e],g.addClass(this.config.classes.storeNotificationAddStoreErrorCollapse);var h=b(this.config.$el.find("[data-"+this.config.data.storeId+"="+e+"]")),i=h.find(this.config.selectors.storeIconNotificationButton),j=this.config.$el.find(this.config.selectors.storeInfoStore),k=j.data(this.config.data.storeInfoStoreId),l=j.find(this.config.selectors.storeInfoStoreNotification);i.removeClass(this.config.classes.storeIconNotificationButtonEdit),e===k&&l.removeClass(this.config.classes.storeIconNotificationButtonEdit),this.config.selectedStoresArray=this.config.selectedStoresArray.filter(function(a){return a!==e});var m=c.find(this.config.selectors.storeNotificationButtonNext),n=c.find(this.config.selectors.storeNotificationButtonSubmit);0===Object.keys(this.config.storeNotificationStores).length?(m[0].disabled=!0,n[0].disabled=!0,b(".md-fsf__store-icon-notification-item--pilot-notify-a").css("display","flex"),b(".md-fsf__store-icon-notification-item--pilot-notify-b").css("display","none")):Object.keys(this.config.storeNotificationStores).length<3&&b(c.find(this.config.selectors.storeNotificationAddStore)).show()},this),0),a.preventDefault()},n.prototype._getUrlParametersAsObject=function(a){return JSON.parse('{"'+decodeURI(a).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')},n.prototype._initStorePopUp=function(a){for(var b=0;b-1?a.config.selectedFilters.splice(c,1):a.config.selectedFilters.push(b(this).val()),a._getStores()})},i.prototype._queryMap=function(a){this.geocoder.geocode({address:a},_.bind(this._geocoderCallback,this))},i.prototype._geocoderCallback=function(c,d){d===a.google.maps.GeocoderStatus.OK?(this.config.$el.find(this.config.selectors.searchError).hide(),this.config.$el.find(this.config.selectors.storeListSearchError).hide(),this.query_location=c[0].geometry.location,this.map.setCenter(this.query_location),this._getStores()):(this.config.$el.find(this.config.selectors.searchError).show(),this.config.$el.find(this.config.selectors.storeListSearchError).show(),b(".md-fsf__filters-container").removeClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").removeClass("wg-fsfb__search-form--disabled"))},i.prototype._getStores=function(){google.maps.event.removeListener(this.zoomChangedListener),google.maps.event.removeListener(this.dragEndListener),b(".md-fsf__filters-container").addClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").addClass("wg-fsfb__search-form--disabled"),this._clearAllMarkers(),this.config.$el.find(this.config.selectors.finderLoading).addClass(this.config.classes.loadingVisible);var a;a=h.IsAntigenTestFinder?{lang:g.getShortLanguageCode(),testAvailable:this.config.selectedFilters.join(","),lat:this.query_location.lat(),lng:this.query_location.lng(),minLat:this.map.getBounds().getSouthWest().lat(),minLng:this.map.getBounds().getSouthWest().lng(),maxLat:this.map.getBounds().getNorthEast().lat(),maxLng:this.map.getBounds().getNorthEast().lng()}:{lang:g.getShortLanguageCode(),covidBrands:this.config.selectedFilters.join(","),lat:this.query_location.lat(),lng:this.query_location.lng(),minLat:this.map.getBounds().getSouthWest().lat(),minLng:this.map.getBounds().getSouthWest().lng(),maxLat:this.map.getBounds().getNorthEast().lat(),maxLng:this.map.getBounds().getNorthEast().lng()},b.ajax({method:"GET",url:"/sdmapi/store/GetCovidShotStores",data:a}).done(_.bind(function(a){if(a){this.config.storeHoursPopUps={},this.config.$el.find(this.config.selectors.finderLoading).removeClass(this.config.classes.loadingVisible),this._renderStoreList(a),this._addMarkerToMap(a);var c=this;this.dragEndListener=google.maps.event.addListenerOnce(this.map,"dragend",function(){c.dragEndListener=google.maps.event.addListenerOnce(c.map,"idle",function(){c._getStores()})}),this.zoomChangedListener=google.maps.event.addListenerOnce(this.map,"zoom_changed",function(){c._getStores()}),b(".md-fsf__filters-container").removeClass("md-fsf__filters-container--disabled"),b(".wg-fsfb__search-form").removeClass("wg-fsfb__search-form--disabled")}},this)).fail(function(a){console.log(a)})},i.prototype._addMarkerToMap=function(a){if(0!==a.length){this.bounds=new google.maps.LatLngBounds;for(var c=_.template(b(this.config.templates.storeInfo).html()),d=0;d0?e.storeUrl="https://stores.shoppersdrugmart.ca/"+g.getShortLanguageCode()+"/store/"+e.StoreID:e.storeUrl="https://stores.pharmaprix.ca/"+g.getShortLanguageCode()+"/store/"+e.StoreID;var f=d+1,i="",j={};h.IsAntigenTestFinder?e.AntigenTestAvailable?(i="/static/core/images/covid-shot-available-pin.png",j={text:String(f),fontSize:"16px",fontWeight:"bold",color:"white"}):(i="/static/core/images/covid-shot-unavailable-pin.png",j={text:String(f),fontSize:"16px",fontWeight:"bold",color:"black"}):e.VaccineAvailable?(i="/static/core/images/covid-shot-available-pin.png",j={text:String(f),fontSize:"16px",fontWeight:"bold",color:"white"}):(i="/static/core/images/covid-shot-unavailable-pin.png",j={text:String(f),fontSize:"16px",fontWeight:"bold",color:"black"});var k=new google.maps.Marker({position:{lat:e.Latitude,lng:e.Longitude},map:this.map,label:j,icon:{url:i,scaledSize:new google.maps.Size(24.5,35.5),labelOrigin:new google.maps.Point(12,15)}});this.markers.push(k);var l=new google.maps.InfoWindow({content:c({store:e})});k.addListener("click",_.bind(this._openInfoWindow,this,l,this.map,k))}}},i.prototype._openInfoWindow=function(a,b,c){this.lastInfoWindow&&this.lastInfoWindow.close(),a.open(b,c),this.lastInfoWindow=a,google.maps.event.addListener(a,"domready",_.bind(this._initInfoWindow,this))},i.prototype._initInfoWindow=function(){var a=b(this.config.$el.find(this.config.selectors.storeInfoStoreHours)),c=b(a.closest(this.config.selectors.storeInfoStore));this.config.tempStoreId=c.data(this.config.data.storeInfoStoreId)},i.prototype._clearAllMarkers=function(){for(var a=0;a0){this.config.$el.find(this.config.selectors.searchError).hide(),this.config.$el.find(this.config.selectors.storeListSearchError).hide();for(var c=0;a.length>c;c++)window.location.host.search("shoppersdrugmart")>0?a[c].storeUrl="https://stores.shoppersdrugmart.ca/"+g.getShortLanguageCode()+"/store/"+a[c].StoreID:a[c].storeUrl="https://stores.pharmaprix.ca/"+g.getShortLanguageCode()+"/store/"+a[c].StoreID;this.config.$el.find(this.config.selectors.storeList).removeClass(this.config.classes.storeListCollapse);var d=_.template(b(this.config.templates.storeList).html());this.config.$el.find(this.config.selectors.storeList).html(d({storeList:a,medmeBypassProvinces:h.MedmeBypassProvinces}))}else this.config.$el.find(this.config.selectors.storeList).addClass(this.config.classes.storeListCollapse),this.config.$el.find(this.config.selectors.searchError).show(),this.config.$el.find(this.config.selectors.storeListSearchError).show()},i.prototype._getUrlParametersAsObject=function(a){return JSON.parse('{"'+decodeURIComponent(a).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')},i.prototype._initStorePopUp=function(a){for(var c=0;cb.name?1:0}),a},categoryFilters:function(){var a=f.map(function(a){return{id:a.id,name:a.Name}});return a.sort(function(a,b){return a.nameb.name?1:0}),a},filteredProducts:function(){var a=this.allProducts.map(function(a){var b={inventory:{ShopLabel:j.ShopLabel,checkStockCountLabel:j.CheckOtherStoresLabel,CheckAvailabilityLabel:j.CheckAvailabilityLabel,stockCountLabel:j.InStoreLabel,ourStockLabel:j.OurStockLabel}};return Object.assign({},a,b)});return this.brandFiltersSelected.length>0&&(a=a.filter(function(a){return!!a.Content.Brand&&this.brandFiltersSelected.includes(a.Content.Brand.ID)}.bind(this))),this.categoryFiltersSelected.length>0&&(a=a.filter(function(a){var b=a.Taxonomies.reduce(function(a,b){return a.push(b.Category.id),a},[]);return!!this.categoryFiltersSelected.find(function(a){return b.includes(a)})}.bind(this))),a},products:function(){return this.$el.querySelector(".module-gift-card-mall__products")&&TweenLite.to(this.$el.querySelector(".module-gift-card-mall__products"),.3,{opacity:1}),this.filteredProducts.sort(function(a,b){return a.Content.Titleb.Content.Title?1:0}).slice(0,this.productsPerPage*this.currentPage)},isLoadMoreVisible:function(){return this.products.length1){for(var b=0;b0){c.DescriptionCTAHref=c.DescriptionCTA.match(/href="([^"]*)/)[1],c.DescriptionCTATarget=c.DescriptionCTA.match(/target="([^"]*)/)[1];var d=document.createElement("span");d.innerHTML=c.DescriptionCTA,c.DescriptionCTALabel=d.textContent||d.innerText}if(c.DescriptionCTA2&&c.DescriptionCTA2.length>0){c.DescriptionCTAHref2=c.DescriptionCTA2.match(/href="([^"]*)/)[1],c.DescriptionCTATarget2=c.DescriptionCTA2.match(/target="([^"]*)/)[1];var e=document.createElement("span");e.innerHTML=c.DescriptionCTA2,c.DescriptionCTALabel2=e.textContent||e.innerText}"False"===f.HideProvinceSelector?f.Slides[b].Provinces.includes(a)&&this.slides.push(c):this.slides.push(c)}},filterBottomCtaBadges:function(a){this.bottomCtaBadges=[];for(var b=0;b0;){var d=[],e=c.splice(0,this.drugPerPage);e.length>0&&d.push(e),e=c.splice(0,this.drugPerPage),e.length>0&&d.push(e),this.paginatedDrugs.push(d)}this.paginatedDrugs&&this.paginatedDrugs.length>0&&this.drugListing.push(this.paginatedDrugs[0])}},this))},setActiveDrug:function(a){this.activeDrug=a},setActivePage:function(a){this.drugListing=[],this.activePage=a,this.paginatedDrugs&&this.paginatedDrugs[this.activePage]&&this.drugListing.push(this.paginatedDrugs[this.activePage]),d.scrollTo$ElementAsync($(this.$refs.drugListing))},loadMore:function(){this.activePage+10&&this.drugListing.push(this.paginatedDrugs[0])},toggleFilter:function(a){a.preventDefault(),this.activeFilter="Common"===this.activeFilter?"Brand":"Common"}},mounted:function(){this.getDrugsByFirstLetter(),this.$root.$on("pop-up-closed",function(){this.activeDrug=null},this),window.addEventListener("resize",this.handleResize)},computed:{alphabets:function(){for(var a=[],b=0;b<26;b++)a.push(String.fromCharCode(b+65));return a}},watch:{activeFilter:function(){this.paginatedDrugs=[],this.activePage=0,this.drugListing=[],this.getDrugsByFirstLetter(),this.$nextTick(_.bind(function(){var a=this.$refs["filter"+this.activeFilter];a&&a.focus()},this))}}})}}(this),function(a){var b=a.NR||(a.NR={}),c=b.resolve("SDM.Core.Modules"),d=b.resolve("SDM.DrugFinder.VueComponents");c.DrugFinderSearch=function(){new Vue({components:{"drug-finder-popup":d.PopUp},computed:{drugsSorted:function(){return this.drugs.sort(function(a,b){var c=a.IsBrand?a.BrandName:a.CommonName,d=b.IsBrand?b.BrandName:b.CommonName,e=new RegExp(this.searchTerm,"ig"),f=new RegExp(this.searchTerm,"ig"),g=e.exec(c),h=f.exec(d),i=g?g.join().length:0,j=h?h.join().length:0;return j>i?1:jd.toLowerCase()?1:0}.bind(this))}},data:function(){return{activeDrug:null,drugs:[],isDropdownVisible:!1,isDropdownLoading:!1,getDrugsBySearchTimeout:null,popupReferenceName:"drugFinderSearchPopup",searchTerm:"",isNoResultsFound:!1}},el:"#module-drug-finder-search",methods:{getDrugsBySearch:function(){if(!this.searchTerm||""===this.searchTerm||this.searchTerm.length<3)return void(this.drugs=[]);this.isDropdownLoading=!0,$.ajax({context:this,data:{search:this.searchTerm},method:"GET",url:"/en/DrugFinder/GetDrugsBySearch"}).done(function(a,b){"success"===b&&(this.drugs=JSON.parse(a),this.drugs.length>0?(this.isNoResultsFound=!1,this.isDropdownVisible=!0):this.isNoResultsFound=!0)}).always(function(){this.isDropdownLoading=!1})},getHighlightedDrugName:function(a){var b=a.IsBrand?a.BrandName:a.CommonName,c=new RegExp(this.searchTerm,"ig");return b.replace(c,function(a){return''+a+""})},reloadGetDrugsBySearch:function(){this.isNoResultsFound=!1,this.isDropdownVisible=!1,this.getDrugsBySearchTimeout&&clearTimeout(this.getDrugsBySearchTimeout),this.getDrugsBySearchTimeout=setTimeout(function(){this.getDrugsBySearch()}.bind(this),500)},search:function(){if(!this.searchTerm||""===this.searchTerm||this.searchTerm.length<3)return void(this.drugs=[]);this.reloadGetDrugsBySearch()},submit:function(){this.search(),0!==this.drugs.length&&this.setActiveDrug(this.drugs[0])},setActiveDrug:function(a){this.activeDrug=a},hideDropdown:function(){this.activeDrug||(this.isDropdownVisible=!1)},showDropdown:function(){this.drugs.length>0&&(this.isDropdownVisible=!0)}},mounted:function(){this.$root.$on("pop-up-closed",function(){this.activeDrug=null},this)}})}}(this),function(a){(a.NR||(a.NR={})).resolve("SDM.Core.Modules").DrugFinderDetails=function(){new Vue({el:"#module-drug-finder-details",data:function(){return{}},methods:{print:function(){a.print()}},mounted:function(){}})}}(this),function(a,b){var c=a.NR||(a.NR={}),d=c.resolve("SDM.Core.Modules"),e=this.SDM||(this.SDM={}),f=e.SubscriptionData||(e.SubscriptionData={}),g=c.resolve("SDM.Util"),h=c.resolve("SDM.Vue.Mixins");d.Subscription=function(){new Vue({el:"#module-subscription",data:function(){return{emailAddress:"",isPCOptimumSubscriptionLoading:!1,isSubscriptionLoading:!1,isPCOptimumSubscriptionConsented:"false",isPCOptimumSubscriptionCompleted:!1,isSubscriptionCompleted:!1,province:""}},methods:{formSubmit:function(){this.subscribe(),"true"===this.isPCOptimumSubscriptionConsented?this.pcoSubscribe():this.isPCOptimumSubscriptionCompleted=!0},pcoSubscribe:function(){this.isPCOptimumSubscriptionLoading=!0,b.ajax({context:this,cache:!1,contentType:"application/x-www-form-urlencoded",type:"POST",url:"/subscribe",data:{email:this.emailAddress,casl:""}}).done(function(a){"True"===a?(this.isPCOptimumSubscriptionLoading=!1,this.isPCOptimumSubscriptionCompleted=!0,g.scrollTo$ElementAsync(b("#module-subscription"))):console.log(err)}).fail(function(a){console.log(a)})},subscribe:function(){this.isSubscriptionLoading=!0,b.ajax({context:this,data:{email:this.emailAddress,subscriberKey:f.SubScriberKey,apiKey:f.ApiKey,siteCode:f.SiteCode,langCode:f.LangCode,sdmPromotion:this.isPCOptimumSubscriptionConsented,province:this.province},headers:{__RequestVerificationToken:f.Token},method:"POST",url:"/global/subscriptionsubmit"}).done(function(a,c){"success"===c?(this.isSubscriptionLoading=!1,this.isSubscriptionCompleted=!0,g.scrollTo$ElementAsync(b("#module-subscription"))):console.log(a)}).always(function(){this.isDropdownLoading=!1})}},mixins:[h.Geolocation],watch:{provinceCode:function(a){this.province=a}}})}}(this,this.jQuery),function(a){"use strict";var b=a.NR,c=b.resolve("SDM.Promotions");c.Initializer={init:function(){new Vue({el:"#app-all-optimum-offers",data:function(){return{filterSelected:"",promotionsModel:[],promotionsDisplayData:[],rootUrl:""}},mounted:function(){this.rootUrl=this.$el.attributes["data-root-url"].value,this.promotionsModel=JSON.parse(this.$el.attributes["data-promotions-model"].value),this.updatePromotionsDisplayData()},methods:{updatePromotionsDisplayData:function(){this.promotionsDisplayData=[];for(var a=[],b=0;b0;return a=a||d.isArray(this._json.Promotions.Promotion)},a.prototype._findProperProductList=function(){var a=d(this._json.Promotions.Promotion).find(function(a){return"Zoned"===a._Type}),b=a?a.Product:this._json.Promotions.Promotion.Product;if(!d.isArray(b)){var c=[];return c.push(b),c}return b},a.prototype.getArray=function(){return this._products},a.prototype.getRawData=function(){return this._json},f.EflyerProductDataLoader={load:function(a,b){var c=e.Deferred();return e.get(this.getApiUrl(a,b)).done(d(function(a){c.resolve(this.parse(a))}).bind(this)).fail(function(a){c.reject(a)}),c.promise()},getApiUrl:function(a,b){return"/Handlers/EFlyerPromotions.ashx?category="+encodeURIComponent(a)+"&postalCode="+encodeURIComponent(b)},parse:function(b){return new a(b)}}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.SDM||(a.SDM={}),e="eflyer",f=a.NR||(a.NR={}),g=f.resolve("SDM.Core.Components.SliderCarousel"),h=d.EflyerProductDataLoader,i=null;i=d.Eflyer=function(a){this._setInstanceVars(a),this._initialize()},i.prototype._setInstanceVars=function(a){this.consts={selectors:{carousel:"[data-wg-efl-carousel]",category_button:"[data-wg-efl-category-button]",postal_code_input:"[data-wg-efl-postal-code-input]",ml_text_overflow:"[data-wg-efl-ml-text-overflow]",category_select:"[data-wg-efl-category-select]"},attributes:{initial_category:"data-wg-efl-initial-category",category_button:"data-wg-efl-category-button",postal_code_input:"data-wg-efl-postal-code-input",carousel_item_template:"data-wg-efl-carousel-item-template",pagination_button_template:"data-wg-efl-carousel-pagination-template",loading:"data-wg-efl-carousel-loading"},class_names:{active:"active"}},this.slider_carousel_options={selectors:{carousel_container:"[data-wg-efl-carousel-container]"},attributes:{pc_visible:"wg-efl-number-visible-pc",mob_visible:"wg-efl-number-visible-mob",pc_toggle_at_once:"wg-efl-toggle-at-once-pc",mob_toggle_at_once:"wg-efl-toggle-at-once-mob"}},this.$container=a,this.category="",this.initial_category=a.attr(this.consts.attributes.initial_category),this.postal_code=a.find(this.consts.selectors.postal_code_input).attr("placeholder"),this.carousel=new g(a.find(this.consts.selectors.carousel),this.slider_carousel_options),this.$category_select=a.find(this.consts.selectors.category_select),this.locked=!1,this.carousel_item_template=b.template(a.find("["+this.consts.attributes.carousel_item_template+"]").html()),this.pagination_button_template=b.template(a.find("["+this.consts.attributes.pagination_button_template+"]").html()),this.$loading=a.find("["+this.consts.attributes.loading+"]")},i.prototype._initialize=function(){this._changeCategory(this.initial_category),this._bindInputEvents(),this._bindSelectEvents()},i.prototype._updateCarousel=function(){d.Util.validatePostalCode(this.postal_code.toUpperCase())&&(this.carousel.hideMainContainer(),this.$loading.show(),this.locked=!0,h.load(this.category,this.postal_code.toUpperCase()).done(b(function(a){var b=a.getArray();this.carousel.renderPanels(this.carousel_item_template({products:b})),this.carousel.renderPaginationButtons(this.pagination_button_template({length:b.length})),this.carousel.setNumberOfPanels(b.length),this.carousel.showMainContainer(),this.$loading.hide(),this.$container.find(this.consts.selectors.ml_text_overflow).mlTextOverflow(),this.locked=!1}).bind(this)))},i.prototype._bindInputEvents=function(){this.$container.on("keypress."+e,this.consts.selectors.postal_code_input,b.bind(this._onKeyPressPostalCodeInput,this)),this.$container.on("change."+e,this.consts.selectors.postal_code_input,b.bind(this._onChangePostalCodeInput,this)),this.$container.on("click."+e,this.consts.selectors.category_button,b.bind(this._onClickCategoryButton,this))},i.prototype._bindSelectEvents=function(){this.$category_select.on("change."+e,b(function(a){this._changeCategory(c(a.currentTarget).val())}).bind(this))},i.prototype._unbindSelectEvents=function(){this.$category_select.off("change."+e)},i.prototype._onKeyPressPostalCodeInput=function(a){var b=c(a.currentTarget);13!==a.which||this._isLocked()||(this.postal_code=""!==b.val()?b.val():b.prop("placeholder"),this._updateCarousel())},i.prototype._onChangePostalCodeInput=function(a){var b=c(a.currentTarget);this._isLocked()||(this.postal_code=""!==b.val()?b.val():b.prop("placeholder"),this._updateCarousel())},i.prototype._onClickCategoryButton=function(a){var b=c(a.currentTarget),d=b.attr(this.consts.attributes.category_button);this._changeCategory(d)},i.prototype._changeCategory=function(a){this._isLocked()||(this.category=a,this.$container.find(this.consts.selectors.category_button).removeClass(this.consts.class_names.active).filter("["+this.consts.attributes.category_button+"='"+a+"']").addClass(this.consts.class_names.active),this._unbindSelectEvents(),this.$category_select.val(a),this._bindSelectEvents(),this._updateCarousel())},i.prototype._isLocked=function(){return this.locked},i.prototype.updateCarousel=function(){this.carousel.updateMode()}}.call(this),function(){function a(a,b){this._initialize(a,b)}var b=this,c=b._,d=b.jQuery,e=b.NR||(b.NR={}),f=e.resolve("SDM"),g=e.resolve("SDM.Core.Components"),h=g.TabGroup,i=f.Util;a.prototype._initialize=function(a,b){var e=d("."+a.searchResultsClass),g=d("."+a.categoryLandingClass);if(e.length>0||g.length>0){this.config=a,this.statusObj={query:"",page:1,numres:a.resultsPerPage,filters:"",srhtype:"all",subbusunit:"all",sort:a.defaultSort,catid:""},this.queryObj={},this.responseObj={},this.checkboxes=b,this.searchURL=d(".ajax-form",this.$element).attr("action"),this.newfilters=!0,this.filters=[],this.urlVars=f.Util.getUrlVars(),this.statusObj=d.extend(!0,this.statusObj,this.urlVars||{});var i=f.Util.getFullLanguageCode(),j=c.isUndefined(this.urlVars.fltCat)?this.urlVars.fltcat:this.urlVars.fltCat;if(this.langMatch=!c.isUndefined(this.urlVars.quelang)&&this.urlVars.quelang===i||!c.isUndefined(j),e.length>0){this.$element=e,this.mode="search",this.tabs=new h(e,{selectors:{button:"[data-srh-tab-button]",content:"[data-srh-tab-content]"},attributes:{button:"data-srh-tab-button",content:"data-srh-tab-content"},classnames:{buttonDefault:"active",contentDefault:"wg-tcl-active"}}),this.tabs.onSwitch(function(a,b,c,d){d.trigger("reloadSearch",[{reloadType:"changeTab",newTabNum:a}])}),this.tabKey={all:1,products:2,articles:3,conditions:4};var k=c.bind(this._setUpFilter,this);$filters=d(".flt-mod",this.$element),c.each($filters,k),this._setUpFilterScroll(),this.$element.on("submit",c.bind(function(a){var b=d(this.config.queryInputSelector,this.$element).val();a.preventDefault(),history.pushState({reloadType:"changeQuery",query:b},"search query",window.location.href.replace(/query=.*?((?=&)|$)/,"query="+encodeURIComponent(b))),this.statusObj.page=1,this._reloadResults()},this))}g.length>0&&(this.$element=g,this.mode="category",this.statusObj.facets="products",this.statusObj.srhtype="products",this.statusObj.catid=d(".cat-lan-id").val(),this.$currentItmLst=d(".itm-lst",this.$element));var l=c.bind(this._handleReloadEvent,this),m=c.bind(this._handlePopEvent,this);if(this.$element.on("reloadSearch",l),this._reloadResults(),history.pushState){var n=window.location.href.match(/query=(.*?((?=&)|$))/,"query="+this.statusObj.query);history.replaceState({reloadType:"changeQuery",query:null!==n&&n.length>=1?n[1]:""},"search query",window.location.href),window.onpopstate=m}}},a.prototype._loadBV=function(a){var b={};void 0!==window.$BV&&(!1===a&&(a=[]),a.length>0&&(c.each(a,function(a){"undefined"!==a.Upc&&a.url&&(b[a.Upc.toString()]={url:document.location.protocol+"//"+document.location.host+a.url.toString()})}),$BV.ui("rr","inline_ratings",{productIds:b,containerPrefix:"BVRRInlineRating"})))},f.SearchResults=function(b,c){var e={searchResultsClass:"srh-res-form",categoryLandingClass:"cat-lan-form",loadMoreClass:"itm-lst-more",filterClass:"flt-mod",queryInputSelector:'[name="query"]',resultsPerPage:18,defaultFacets:"articles,conditions,products",defaultSort:"relavance",loadingClass:"srh-loading"};return this.config=d.extend(!0,e,b||{}),new a(this.config,c)},a.prototype._handleReloadEvent=function(a,b){var e=c.bind(this._parseCurrentFilters,this);if(!c.isUndefined(b))switch("changePage"!==b.reloadType&&(this.statusObj.page=1),b.reloadType){case"changeQuery":this.statusObj.query=d(this.config.queryInputSelector,this.$element).val(),this.newfilters=!0,this.statusObj.filters="";break;case"changeTab":this.statusObj.srhtype=c.invert(this.tabKey)[b.newTabNum],this.statusObj.sort=this.config.defaultSort,this.newfilters=!0,this.statusObj.filters="";break;case"changeSort":this.statusObj.sort=b.newSortType;break;case"changeFilter":this.statusObj.filters=e();break;case"changePage":this.statusObj.page=b.newPage,this.statusObj.filters=e()}this._reloadResults(b.reloadType)},a.prototype._handlePopEvent=function(a){"changeQuery"===a.state.reloadType&&(d(this.config.queryInputSelector,this.$element).val(a.state.query),this._handleReloadEvent(a,a.state))},a.prototype._parseCurrentFilters=function(){var a="",b=d(".flt-mod",this.$currentItmLst);return c.each(b,function(b){var e=d(b),f=d(".flt-lst-checked",e),g=d(".flt-lst-chbx",e).first().data("srh-flt-type");0===f.length?a=a+g+"NOFILTERS,":c.each(f,function(b){var e=d(b),f=e.data("srh-flt-type");f=c.isUndefined(f)?"sections,":f,a=a+f+encodeURIComponent(e.data("srh-checkbox"))+","})}),a},a.prototype._reloadResults=function(a){"search"===this.mode&&(this.currentTabNum=this.tabKey[this.statusObj.srhtype],this.currentTabNum=c.isUndefined(this.currentTabNum)?1:this.currentTabNum,this.tabs.goToTab(this.currentTabNum,!0)),"changePage"!==a&&this._clearResults(),this._makeQuery()},a.prototype._clearResults=function(){d(".itm-lst-header, .itm-lst-cnt",this.$currentItmLst).html(""),!0===this.newfilters&&d(".itm-lst-menu",this.$currentItmLst).hide(),"search"===this.mode&&(this.$currentItmLst=d(".tab-cont-"+this.statusObj.srhtype+" .itm-lst")),!0===this.newfilters&&"search"===this.mode&&d(".itm-lst-menu",this.$currentItmLst).html(""),this.$element.addClass(this.config.loadingClass)},a.prototype._makeQuery=function(){c.isUndefined(this.currentRequest)||this.currentRequest.abort();var a="type";"all"!==this.statusObj.srhtype&&(a+=",sections");var b="";switch(this.statusObj.srhtype){case"all":break;case"products":b="type,Product,"+this.statusObj.filters;break;case"articles":b="type,Article,"+this.statusObj.filters;break;case"conditions":b="type,Condition,"+this.statusObj.filters}var e=d(this.config.queryInputSelector,this.$element).val();if(this.queryObj={query:e,page:this.statusObj.page,numRes:this.statusObj.numres,facets:a,filters:b,getFilters:this.newfilters},"category"===this.mode){"0"===this.statusObj.catid||c.isUndefined(this.statusObj.catid)||(this.queryObj.categoryId=this.statusObj.catid);var f=c.isUndefined(this.urlVars.fltCat)?this.urlVars.fltcat:this.urlVars.fltCat;if(!(c.isUndefined(this.urlVars.brand)&&c.isUndefined(f)||(this.queryObj.brand=this.urlVars.brand,!0!==this.newfilters||!0!==this.langMatch))){var g="";c.each(this.urlVars,function(a,b){"flt-"!==b.slice(0,4)&&b.slice(0,6).toUpperCase()!=="fltCat".toUpperCase()||(g=g+","+encodeURIComponent(a)+",")}),this.queryObj.filters=b+g}}else c.isUndefined(this.urlVars.permflt)||(this.queryObj.andFilters=this.urlVars.permflt);var h=c.bind(this._populateResults,this),i=c.bind(this._ajaxErrorHandler,this);this.currentRequest=d.ajax({type:"POST",url:this.searchURL,data:this.queryObj,success:h,error:i})},a.prototype._ajaxErrorHandler=function(a,b,e){if("abort"!==e){var f=d("#SrhTemplError").html();d(".itm-lst-header",this.$currentItmLst).html(c.template(f,{})),this.$element.removeClass(this.config.loadingClass),d(".itm-lst-more--loading").removeClass("itm-lst-more--loading")}},a.prototype._populateResults=function(a){this.responseObj=a;var b={srhtype:this.statusObj.srhtype,query:this.responseObj.SwiftypeResults.info.page.query,current_page:this.responseObj.SwiftypeResults.info.page.current_page,num_pages:this.responseObj.SwiftypeResults.info.page.num_pages,per_page:this.responseObj.SwiftypeResults.info.page.per_page,total_result_count:this.responseObj.SwiftypeResults.info.page.total_result_count,results:this.responseObj.SwiftypeResults.records.page,storeResultTitle:this.responseObj.StoreResult.Title,storeResultUrl:"store-locator/store/"+this.responseObj.StoreResult.Id,filter_modules:this.responseObj.FilterModules,event_label:this.mode};b.storeResultTitle&&b.total_result_count++,c.isUndefined(this.responseObj.Info)||(b.all_total_result_count=this.responseObj.Info.page.total_result_count,b.facets_type=this.responseObj.Info.page.facets.type),c.each(b.results,function(a){if(a.published_at){var b,c=new Date(a.published_at);if(isNaN(c.getTime()))return void(a.published_at_formatted=null);b="fr"===i.getShortLanguageCode()?c.format("%r %B %Y","fr"):c.format("%b %r, %Y","en"),a.published_at_formatted=b}}),c.isNull(this.responseObj.SwiftypeResults.info.page.facets)||(b.facets_sections=this.responseObj.SwiftypeResults.info.page.facets.sections),"search"===this.mode&&(d(".res-num",this.$element).html("0"),d(".tab-all .res-num",this.$element).html(b.all_total_result_count),c.each(b.facets_type,function(a,b){var c=b.toLowerCase(),e=null===a?"0":a;d(".tab-"+c+" .res-num").html(e)}));var e=d("#SrhTemplHeader").html();d(".itm-lst-header",this.$currentItmLst).html(c.template(e)({templData:b}));var f=d(".itm-lst-menu",this.$currentItmLst);if("articles"!==this.statusObj.srhtype&&"conditions"!==this.statusObj.srhtype||!0!==this.newfilters){if("products"===this.statusObj.srhtype&&!0===this.newfilters&&!c.isUndefined(b.filter_modules)){if("search"!==this.mode&&this.urlVars.brand&&d(".flt-tax").hide(),!c.isUndefined(b.filter_modules.Brands)&&!c.isNull(b.filter_modules.Brands)){var g=c(b.filter_modules.Brands.Results).sortBy("Name"),h=c.groupBy(g,function(a){return a.Name.charAt(0).toLowerCase()}),j=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],k={};c.each(j,function(a){c.isUndefined(h[a])?k[a]=[]:k[a]=h[a]}),b.groupedBrands=k,b.numBrands=b.filter_modules.Brands.Results.length;var l=d("#SrhTemplBrandFlt").html();d(".itm-lst-menu",this.$currentItmLst).append(c.template(l)({templData:b}))}var m=d("#SrhTemplChbx").html();if(!c.isUndefined(b.filter_modules.Tags)&&!c.isNull(b.filter_modules.Tags)){var n={fltName:"Tags",prefix:b.filter_modules.Tags.Info[0].Prefix,filterByName:b.filter_modules.Tags.Info[0].FilterName,results:b.filter_modules.Tags.Results};d(".itm-lst-menu",this.$currentItmLst).prepend(c.template(m)({specTempData:n}))}c.each(b.filter_modules,function(a,b){if("Brands"!==b&&"Tags"!==b&&!c.isNull(a)){var e={fltName:b,prefix:a.Info[0].Prefix,filterByName:a.Info[0].FilterName,results:a.Results};0!==e.results.length&&d(".itm-lst-menu",this.$currentItmLst).append(c.template(m)({specTempData:e}))}});var o=c.bind(this._setUpFilter,this);$filters=d(".flt-mod",this.$currentItmLst),c.each($filters,o)}}else d(".flt-res-num",f).html("0"),c.each(b.facets_sections,function(a,b){d("[data-srh-checkbox='"+b.toLowerCase()+"']",f).siblings(".flt-lst-name-wrp").find(".flt-res-num").html(a)});d(".itm-lst-menu",this.$currentItmLst).show();var p=c.isUndefined(this.urlVars.fltCat)?this.urlVars.fltcat:this.urlVars.fltCat;"category"!==this.mode||!0!==this.newfilters||c.isUndefined(this.urlVars.brand)&&c.isUndefined(p)||!0!==this.langMatch||c.each(this.urlVars,function(a){var b=decodeURIComponent(a).split(":"),c=b[0],e=b[1]||"",f=d("[data-srh-flt-type='"+c+":'][data-srh-checkbox='"+e.replace(/'/g,"\\'")+"']"),g=f.parents(".flt-mod");f.length>0&&(d(".flt-lst-checked",g).removeClass("flt-lst-checked").attr("aria-checked",!1),f.addClass("flt-lst-checked").attr("aria-checked",!0),d(".nano",g).nanoScroller({scrollTo:f.parents(".flt-lst-item")}))});var q=d("#SrhTemplContProducts").html(),r=d("#SrhTemplContText").html();if("products"===this.statusObj.srhtype){if(d(".itm-lst-prod-items",this.$currentItmLst)[0]){var s=d(c.template(q)({templData:b})).children();d(".itm-lst-prod-items",this.$currentItmLst).append(s)}else d(".itm-lst-cnt",this.$currentItmLst).append(c.template(q)({templData:b}));this._loadBV(b.results)}else d(".itm-lst-cnt",this.$currentItmLst).append(c.template(r)({templData:b}));var t=d("#SrhTemplLoadMoreFooter").html();d(".itm-lst-footer",this.$currentItmLst).html(c.template(t)({templData:b})),0===b.total_result_count&&d(".itm-lst-footer",this.$currentItmLst).html(""),this._reinitialiseJS(),this.newfilters=!1,this.$element.removeClass(this.config.loadingClass)},a.prototype._reinitialiseJS=function(){var a=c.bind(this._loadMoreHandler,this),b=c.bind(this._changeDisplayNumber,this);d("."+this.config.loadMoreClass,this.$element).on("click",a),d(".itm-lst-display-num",".itm-lst-header").on("click",b),setTimeout(c.bind(this._setUpFilterScroll,this),0)},a.prototype._changeDisplayNumber=function(a){a.preventDefault(),this.statusObj.numres=d(a.currentTarget).data("itm-lst-display-num"),this.statusObj.page=1,this._reloadResults()},a.prototype._loadMoreHandler=function(a){a.preventDefault(),this.statusObj.page+=1;var b=this.statusObj.page;this.$element.trigger("reloadSearch",[{reloadType:"changePage",newPage:b}]),d(a.currentTarget).addClass("itm-lst-more--loading")},a.prototype._sortHandler=function(a){this.$element.trigger("reloadSearch",[{reloadType:"changeSort",newSortType:d(a.currentTarget).val()}])},a.prototype._setUpFilter=function(a){var b=d(a),e=c.bind(this._filterCollapseToggle,this),f=c.bind(this._filterAlphabet,this),g=c.bind(this._filterClear,this),h=c.bind(this._filterSelect,this),i=c.bind(this._chbxToggle,this);if(d(".flt-title",b).off().on("click",e),d(".flt-lst-alph-groups button",b).off().on("click",f),d(".flt-clr",b).off().on("click",g),d(".flt-sel",b).off().on("click",h),d(".flt-lst-chbx",b).off().on("click",i),b.hasClass("chbx-mod")){var j=c.bind(this._filterTreeCollapseToggle,this);d(".flt-lst-name",b).off().on("click",j)}this.filters.push({$filterElement:b})},a.prototype._setUpFilterScroll=function(){c.each(this.filters,function(a){d(".flt-lst-scl-wrp",a.$filterElement).nanoScroller({preventPageScrolling:!0,alwaysVisible:!0})})},a.prototype._chbxToggle=function(a){a.preventDefault();var b=d(a.currentTarget),c="flt-lst-checked";b.hasClass(c)?(b.removeClass(c).attr("aria-checked",!1),b.closest(".flt-lst-item").find("."+c).removeClass(c)):(b.addClass(c).attr("aria-checked",!0),b.parents(".flt-lst-item").children(".flt-lst-itm-label").find(".flt-lst-chbx").addClass(c)),this.$element.trigger("reloadSearch",[{reloadType:"changeFilter"}])},a.prototype._filterCollapseToggle=function(a){a.preventDefault(),$title=d(a.currentTarget),$title.parent().toggleClass("flt-collapsed")},a.prototype._filterTreeCollapseToggle=function(a){a.preventDefault(),$groupTitle=d(a.currentTarget),$groupTitle.parents(".flt-lst-item").first().toggleClass("flt-lst-closed")},a.prototype._filterAlphabet=function(a){a.preventDefault();var b=d(a.currentTarget),c=b.parent(),e=b.parents(".flt-mod"),f="active";c.siblings("."+f).removeClass(f),c.addClass(f),scrollToLetter=d(a.currentTarget).data("scrollto"),$scrolltoElement=d(".flt-lst-alph-let-"+scrollToLetter,e),d(".nano",e).nanoScroller({scrollTo:$scrolltoElement})}, a.prototype._filterClear=function(a){a.preventDefault();var b=d(a.currentTarget).parents(".flt-mod");d(".flt-lst-chbx",b).removeClass("flt-lst-checked").attr("aria-checked",!1),this.$element.trigger("reloadSearch",[{reloadType:"changeFilter"}])},a.prototype._filterSelect=function(a){a.preventDefault();var b=d(a.currentTarget).parents(".flt-mod");d(".flt-lst-chbx",b).addClass("flt-lst-checked").attr("aria-checked",!0),this.$element.trigger("reloadSearch",[{reloadType:"changeFilter"}])}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.SDM||(a.SDM={}),e=d.Util,f=d.QAB=function(a){var b={qabClass:"qab-wrp",activeClass:"active",preActiveClass:"pre-active",barOpenClass:"qab-open",panelSelector:".qab-tls-cnt",namespace:"qab",fadeDelay:5e3,fadeLength:1e3,input_focus_types:"input[type=text], input[type=tel]",navigateOnClickSelector:"[data-qab-tls-itm-nav-on-click]"};this.config=c.extend(!0,b,a||{}),this.namespace="qab",c("."+this.config.qabClass).length>0&&this._initialize()};f.prototype._initialize=function(){this.$element=c("."+this.config.qabClass);var d=b.bind(this._toggleItem,this);c(".qab-tls-btn",this.$element).on("click",d);var e=b.bind(this._toggleMinimode,this);if(c(".qab-icon",this.$element).on("click",e),c("."+this.config.preActiveClass,this.$element).length>0){var f=b.bind(this._fadeOutItem,this),g=setTimeout(f,this.config.fadeDelay);this.$element.on("mouseenter",function(){clearTimeout(g)})}var h=b.bind(this._toggleVisibleSelect,this);c('.rdo-rpl[data-rdo-name="choice"]',this.$element).on("click",h);var i=c(a);i.on("becometowide",b.bind(this._onWindowBecomeWide,this)),i.on("resizewhennarrow",b.bind(this._onWindowResizeWhenNarrow,this))},f.prototype._toggleItem=function(a){var d=c(a.currentTarget).parent();if(!d.is(this.config.navigateOnClickSelector)){if(a.preventDefault(),d.hasClass(this.config.activeClass))this._hideItems();else{this._showItem(d),c("."+this.config.activeClass,this.$element).not(d).removeClass(this.config.activeClass);var e=b.bind(function(a){0===c(a.target).parents(this.$element.selector).length&&this._hideItems()},this);c("body").on("click."+this.namespace,e)}this._updateBarAndPanelHeightsIfMobile()}},f.prototype._showItem=function(a){a.addClass(this.config.activeClass),a.find(this.config.input_focus_types).first().focus()},f.prototype._hideItems=function(){c("."+this.config.activeClass,this.$element).removeClass(this.config.activeClass),c("body").off("click."+this.namespace)},f.prototype._toggleMinimode=function(a){a.preventDefault(),c(a.currentTarget).parents(".qab-wrp").toggleClass(this.config.barOpenClass),this._updateBarAndPanelHeightsIfMobile()},f.prototype._fadeOutItem=function(){var a=b.bind(this._hideItems,this);c("."+this.config.preActiveClass+" .qab-tls-cnt",this.$element).fadeOut(this.config.fadeLength,function(){a(),c(this).attr("style","")}),this._updateBarAndPanelHeightsIfMobile()},f.prototype._toggleVisibleSelect=function(a){a.preventDefault();var b=c(a.currentTarget),d=b.data("rdo-name"),e=b.data("rdo-value"),f="qab-slt-active",g="rdo-active";c("."+g+'[data-rdo-name="'+d+'"]').removeClass(g),b.addClass(g);var h=c(".qab-slt."+f),i=h.find('select [value=""]').text();h.removeClass(f),h.find("select").val(""),h.find("[data-selectbox-text-container]").text(i),c('.qab-slt[data-qab-srh-selectbox="'+e+'"]').addClass(f)},f.prototype._onWindowResizeWhenNarrow=function(){this._updateBarAndPanelHeightsIfMobile()},f.prototype._onWindowBecomeWide=function(){this.$element.css({bottom:"auto"}),this.$element.find(".qab-tls-cnt").removeAttr("style")},f.prototype._updateBarAndPanelHeightsIfMobile=function(){if(!1!==e.isWindowNarrow()){var b="."+this.config.activeClass,d=this.$element.find(b),f=d.length>0;if(this.$element.hasClass(this.config.barOpenClass)&&f){var g=c(a).width(),h=d.find(this.config.panelSelector);h.css({width:g});var i=h.outerHeight(),j=this.$element.outerHeight(),k=i-j;this._setBottomIfMobile(Math.max(0,k))}else this._setBottomIfMobile(0)}},f.prototype._setBottomIfMobile=function(a){!1!==e.isWindowNarrow()&&this.$element.css({bottom:Math.max(0,a)+"px"})}}.call(this),function(){var a=this,b=a.$SDM||a.jQuery,c=a.NR||(a.NR={}),d=c.resolve("SDM"),e=c.resolve("SDM.Core"),f=c.resolve("SDM.Core.Components"),g=c.resolve("SDM.Core.Modules"),h=c.resolve("SDM.Core.Utils"),i=c.resolve("SDM.Core.Widgets"),j=c.resolve("SDM.Core.Components.BrooklynAuth.Settings"),k=c.resolve("SDM.Subscription"),l=c.resolve("SDM.Vue.Modules"),m=f.EventHub,n=h.OmnitureUtil,o=h.SiteTypes,p=e.Initializer=function(a){var c={modules:{article_and_video_badge_grid:"article-and-video-badge-grid",article_details:"article-details",article_grid_with_vertical_side:"article-grid-with-vertical-side",beauty_blog_post_details:"beauty-blog-post-details",beauty_blog_posts:"beauty-blog-posts",beauty_brands_listing:"beauty-brands-listing",bmi_calculator:"bmi-calculator",brooklyn_offers:"brooklyn-offers",condition_search:"condition-search",filter_toggle:"filter-toggle",image_gallery:"image-gallery",faq_section:"faq-section",featured_deals:"featured-deals",accordion_content_list:"accordion-content-list",video_player_mvc:"video-player-mvc",promo_badge:"promo-badge",pharmacy_service_list:"pharmacy-service-list",pharmacy_service_detail:"pharmacy-service-detail",flyer:"flyer",global_slider:"global-slider",contact_us:"contact-us",overlays:"overlays",brand_details:"brand-details",minor_ailments_list:"minor-ailments-list",custom_product_list:"custom-product-list",store_service_listing:"store-service-listing",global_tile_grid:"global-tile-grid",article_content_grid:"article-content-grid",flu_shot_finder:"flu-shot-finder",covid_shot_finder:"covid-shot-finder",store_locator_per_service:"store-locator-per-service",gift_card_mall:"gift-card-mall",dietitian_quiz:"dietitian-quiz",console_preorder:"console-preorder",console_preorder_banner:"console-preorder-banner",drug_finder_search:"drug-finder-search",drug_finder_listing:"drug-finder-listing",drug_finder_details:"drug-finder-details",subscription:"subscription",find_in_store:"find-in-store",love_you_donation:"love-you-donation",womens_health:"womens-health",apple:"apple",shoebox:"shoebox",sticky_navigation:"sticky-navigation",p3_2021:"p3-2021",global_cta_list:"global-cta-list",featured_products_carousel:"featured-products-carousel",featured_products_carousel_with_badge:"featured-products-carousel-with-badge",stick_promotion_bar:"stick-promotion-bar",dietitian_navigation:"dietitian-navigation",dietitian_book_appointment:"dietitian-book-appointment",dietitian_biography:"dietitian-biography",dietitian_socialfeed:"dietitian-socialfeed",promo_sign_up:"promo-sign-up",spring_2021:"spring-2021",two_level_navigation_menu:"two-level-navigation-menu",product_listing_with_feature_filter:"product-listing-with-feature-filter",summer_2021:"summer-2021",rich_text_area_geo:"rich-text-area-geo",video_product_carousel:"video-product-carousel",province_selector:"province-selector",text_badge_grid:"text-badge-grid",faq:"faq",global_promotion_grid:"global-promotion-grid",universal_cta_item_grid:"universal-cta-item-grid",mental_health_quiz:"mental-health-quiz",cta_offset_nav:"cta-offset-nav"},widgets:{print:"print",dscv_accordion:"dscv-accordion",accordion:"accordion",brooklyn_login:"brooklyn-login",brooklyn_logout:"brooklyn-logout",brooklyn_user_controls:"brooklyn-user-controls",brooklyn_points_refresh:"brooklyn-points-refresh",tab_group:"tab-group",eflyer:"eflyer",hero_carousel:"hero-carousel",slider_carousel:"slider-carousel",redemption_event:"redemption-event",faq_modal:"faq-modal",faq:"faq",unsupported_browser_warning:"unsupported-browser-warning",newsletter_subscription:"newsletter-subscription",image_popup:"image-popup",email_signup_popup:"email-signup-popup",email_signup:"email-signup",pharmacy_service_qab:"pharmacy-service-quick-access-bar",condition_alphabet:"condition-alphabet",featured_video:"featured-video",product_rating:"product-rating",general_article_summary_listing:"general-article-summary-listing",pop_up:"pop-up",pop_up_manager:"pop-up-manager",anchors_in_page:"anchors-in-page",search_bar:"search-bar",social_share:"social-share",flu_shot_finder_banner:"flu-shot-finder-banner",covid_shot_finder_banner:"covid-shot-finder-banner"},analytics:{userId_cookie:"sdm-analytics",custom_dimension_keys:{customer_key:"dimension1",channel:"dimension8",channel_details:"dimension9"}},youtube_api_key:"AIzaSyAqyipvzq62aB7-5OZ35FiVAp4T2WszDTM"};d.Vue.Vuex=new Vuex.Store({}),this.config=b.extend(!0,c,a||{}),j=_.extend(j,{loginEndPoint:this.config.LOGIN_ENDPOINT,protegrityDomain:this.config.PROTEGRITY_DOMAIN}),this._initialize()};p.prototype._initialize=function(){var c=b(a);d.Util({user_ip:this.config.user_ip,lang_code:this.config.lang_code,region:this.config.region}),k({});var e=d.GeoLocation();this._initializeModules(e),this._initializeWidgets(e),this._initializeMultiLinesTextOverflow(),this._initializeProperCase(),this._initializePlaceholder(),this._initializeSearchResults(),this._initializeAnalytics(),this._initializeQAB(),this._initializeImageTitleTag(),new d.Footer,d.Util.activateResizeEvent(),c.on("becometowide",_.bind(n.setSiteType,null,o.DESKTOP)),c.on("becometonarrow",_.bind(n.setSiteType,null,o.MOBILE)),n.setPageLanguage(d.Util.getFullLanguageCode()).setCustomerWalletId("").setLoginStatus(!1).setOptimumClaimed(!1).setSiteType(d.Util.isMobileDevice()?o.MOBILE:o.DESKTOP)},p.prototype._initializeModules=function(a){var c=b("[data-module]"),e=this.config.modules;c.each(_.bind(function(c,f){var h=b(f),i=h.data("module").split(/\s+/);_(i).each(_(function(c){switch(c){case e.article_grid_with_vertical_side:g.ArticleGridWithVerticalSide(h);break;case e.beauty_blog_post_details:this._initializeBeautyBlogPostDetailsModule(h);break;case e.beauty_blog_posts:this._initializeBeautyBlogPostsModule(h);break;case e.beauty_brands_listing:new g.BeautyBrandsListing(h);break;case e.bmi_calculator:this._initializeBmiCalculatorModule(h);break;case e.condition_search:g.ConditionSearch(h);break;case e.filter_toggle:this._initializeFilterToggles(h);break;case e.article_details:g.ArticleDetails(h.get(0));break;case e.image_gallery:this._initializeZooms(h);break;case e.faq_section:if(!l.FaqSection)break;l.FaqSection(h);break;case e.featured_deals:this._initializeFeatuedDeals(h);break;case e.global_slider:g.GlobalSlider(h);break;case e.video_player_mvc:this._initializeVideoPlayerMVC(h);break;case e.accordion_content_list:this._initializeAccordionContentList(h);break;case e.promo_badge:this._initializePromoBadge(h);break;case e.pharmacy_service_list:b.when(a).then(_.bind(function(){this._initializePharmacyServiceList(h,d.GeoLocation.getUsersProvince())},this));break;case e.pharmacy_service_detail:b.when(a).then(_.bind(function(){this._initializePharmacyServiceDetail(h,d.GeoLocation.getUsersProvince())},this));break;case e.flyer:this._initializFlyer(h);break;case e.contact_us:this._initializeContactUs(h);break;case e.overlays:this._initializeOverlays(h);break;case e.brand_details:this._initializeBrandDetails();break;case e.minor_ailments_list:b.when(a).then(_.bind(function(){this._initializeMinorAilmentsList(h,d.GeoLocation.getUsersProvince())},this));break;case e.custom_product_list:this._initializeCustomProductList(h);break;case e.store_service_listing:new g.StoreServiceListing(h);break;case e.global_tile_grid:new g.GlobalTileGrid(h);break;case e.article_content_grid:new g.ArticleContentGrid(h);break;case e.flu_shot_finder:new g.FluShotFinder(h);break;case e.covid_shot_finder:new g.CovidShotFinder(h);break;case e.drug_finder_search:new g.DrugFinderSearch(h);break;case e.drug_finder_listing:new g.DrugFinderListing(h);break;case e.drug_finder_details:new g.DrugFinderDetails(h);break;case e.store_locator_per_service:new g.StoreLocatorPerService(h);break;case e.gift_card_mall:new g.GiftCardMall(h);break;case e.dietitian_quiz:new g.DietitianQuiz(h);break;case e.console_preorder:new l.ConsolePreorder(h);break;case e.console_preorder_banner:new l.ConsolePreorderBanner(h);break;case e.love_you_donation:new l.LoveYouDonation(h);break;case e.apple:new l.Apple(h);break;case e.subscription:new g.Subscription(h);break;case e.find_in_store:new l.FindInStore(h);break;case e.womens_health:new l.WomensHealth(h);break;case e.shoebox:new l.Shoebox(h);break;case e.sticky_navigation:new l.StickyNavigation(h);break;case e.p3_2021:new l.P32021(h);break;case e.promo_sign_up:new l.PromoSignUp(h);break;case e.global_cta_list:new l.GlobalCtaList(h);break;case e.featured_products_carousel:new l.FeaturedProductsCarousel(h);break;case e.featured_products_carousel_with_badge:new l.FeaturedProductsCarouselWithBadge(h);break;case e.stick_promotion_bar:new l.StickyPromotionBar(h);break;case e.spring_2021:new l.Spring2021(h);break;case e.dietitian_navigation:new l.DietitionNavigation(h);break;case e.dietitian_book_appointment:new l.DietitianBookAppointment(h);break;case e.dietitian_biography:new l.DietitionBiography(h);break;case e.dietitian_socialfeed:new l.DietitionSocialFeed(h);break;case e.two_level_navigation_menu:new l.TwoLevelNavigationMenu(h);break;case e.product_listing_with_feature_filter:new l.ProductListingWithFeatureFilter(h);break;case e.article_and_video_badge_grid:new l.ArticleAndVideoBadgeGrid(h);break;case e.summer_2021:new l.Summer2021(h);break;case e.rich_text_area_geo:new l.RichTextAreaGeo(h);break;case e.video_product_carousel:new l.VideoProductCarousel(h);break;case e.province_selector:new l.ProvinceSelector(h);break;case e.text_badge_grid:new l.TextBadgeGrid(h);break;case e.faq:new l.Faq(h);break;case e.global_promotion_grid:new l.GlobalPromotionGrid(h);break;case e.universal_cta_item_grid:new l.UniversalCTAItemGrid(h);break;case e.mental_health_quiz:new l.MentalHealthQuiz(h);break;case e.cta_offset_nav:new l.CTAOffsetNav(h)}}).bind(this))},this))},p.prototype._initializeWidgets=function(a){var c=b("[data-widget]"),e=this.config.widgets;c.each(_.bind(function(c,f){var g=b(f),h=g.data("widget").split(/\s+/),j=this.config;_(h).each(_(function(c){switch(c){case e.print:this._initializePrintIcons(g);break;case e.dscv_accordion:this._initializeDiscoveryAccordions(g);break;case e.accordion:this._initializeAccordions(g);break;case e.brooklyn_login:new i.BrooklynLogin(g,j);break;case e.brooklyn_logout:new i.BrooklynLogout(g);break;case e.brooklyn_points_refresh:new i.BrooklynPointsRefresh({el:f});break;case e.tab_group:this._initializeTabGroup(g);break;case e.eflyer:b.when(a).then(_.bind(this._initializeEflyer,this,g));break;case e.slider_carousel:this._initializeSliderCarousel(g);break;case e.hero_carousel:this._initializeHeroCarousels(g);break;case e.redemption_event:this._initializeRedemptionEvent(g);break;case e.pharmacy_service_qab:b.when(a).then(_.bind(function(){this._initializePharmacyServicesQAB(g,d.GeoLocation.getUsersProvince())},this));break;case e.condition_alphabet:this._initializeConditionAlphabet(g);break;case e.featured_video:this._initializeFeaturedVideo(g);break;case e.product_rating:this._initializeProductRating(g);break;case e.faq_modal:this._initializeFAQModal(g);break;case e.faq:this._initializeFAQ(g);break;case e.unsupported_browser_warning:this._initializeUnsupportedBrowserWarning(g);break;case e.general_article_summary_listing:this._initializeGeneralArticleSummaryListing(g);break;case e.anchors_in_page:this._initializeAnchorsInPage(g);break;case e.pop_up:new i.PopUp(g);break;case e.pop_up_manager:this._initializePopUpManager(g);break;case e.social_share:this._initializeSocialShare(g);break;case e.newsletter_subscription:new i.NewsletterSubscription(g);break;case e.image_popup:new i.ImagePopup(g);break;case e.email_signup_popup:new i.EmailSignupPopup(g);break;case e.email_signup:new i.EmailSignup(g);break;case e.flu_shot_finder_banner:new i.FluShotFinderBanner(g);break;case e.search_bar:i.SearchBar(g);break;case e.covid_shot_finder_banner:new i.CovidShotFinderBanner(g)}}).bind(this))},this))},p.prototype._initializeSliderCarousel=function(a){var b=new f.SliderCarousel(a);m.subscribe(m.EVENTS.TAB_SWITCHED,function(){b.updateMode()})},p.prototype._initializeEflyer=function(a){var b=new d.Eflyer(a);m.subscribe(m.EVENTS.TAB_SWITCHED,function(){b.updateCarousel()})},p.prototype._initializeBeautyBlogPostDetailsModule=function(a){new g.BeautyBlogPostDetails(a)},p.prototype._initializeBeautyBlogPostsModule=function(a){new g.BeautyBlogPosts(a)},p.prototype._initializeBmiCalculatorModule=function(a){new g.BmiCalculator(a)},p.prototype._initializeFilterToggles=function(a){var b=a.find("[data-filter-toggle-button]"),c=a.find("[data-filter-toggle-content]"),d=!0;b.addClass("active"),c.show(),b.on("click.toggle",function(){d?(b.removeClass("active"),c.hide(),d=!1):(b.addClass("active"),c.show(),d=!0)})},p.prototype._initializeAnalytics=function(){var a=d.Util.getValueFromCookie(this.config.analytics.userId_cookie),b=this.config.analytics.custom_dimension_keys,c={},e=d.Util.getUrlVars()||{},f=e.channel||null,g=e.channelDetails||e.channeldetails||null;c[b.customer_key]=a,c[b.channel]=f,c[b.channel_details]=g},p.prototype._initializeMultiLinesTextOverflow=function(){b("[data-ml-text-overflow]").mlTextOverflow(),m.subscribe(m.EVENTS.TAB_SWITCHED,function(a){a.$content.find("[data-ml-text-overflow]").mlTextOverflow()})},p.prototype._initializeProperCase=function(){b("[data-prp-case]").each(function(){var a=b(this).text();b(this).text(d.Util.properCase(a))})},p.prototype._initializePlaceholder=function(){new Placeholder},p.prototype._initializeSearchResults=function(){new d.SearchResults({},"")},p.prototype._initializeHeroCarousels=function(a){new f.HeroCarousel(a)},p.prototype._initializeFeatuedDeals=function(a){new g.FeaturedDeals(a)},p.prototype._initializeAccordions=function(a){var b=new Accordion(a);b.isActive()&&b.open(0)},p.prototype._initializeTabGroup=function(a){new f.TabGroup(a).onSwitch(function(a,b,c){m.fire(m.EVENTS.TAB_SWITCHED,{tabId:a,$button:b,$content:c})})},p.prototype._initializePharmacyServicesQAB=function(a,b){new f.PharmacyServicesQAB(a,b)},p.prototype._initializeDiscoveryAccordions=function(){var a=[];return function(c){var d=new Accordion(c,{selectors:{button:"[data-dscv-accordion-button]",content:"[data-dscv-accordion-content]"},classnames:{active:"dscv-accordion-active",progress_of_showing:"dscv-accordion-showing",progress_of_hiding:"dscv-accordion-hiding"}});Accordion.validate(d)&&a.push(d),1===a.length&&(b(window).on("widen.dscv_accordion",function(){_(a).each(function(a){a.disable(),a.open(0)})}),b(window).on("narrow.dscv_accordion",function(){_(a).each(function(a,b){a.enable(),0===b?a.open(0):a.close(0)})}))}}(),p.prototype._initializeConditionAlphabet=function(a){new i.ConditionAlphabet(a)},p.prototype._initializeZooms=function(){return new f.Zoom},p.prototype._initializeFeaturedVideo=function(a){new i.FeaturedVideo(a,{youtube_api_key:this.config.youtube_api_key})},p.prototype._initializeProductRating=function(a){new i.ProductRating(a)},p.prototype._initializeQAB=function(){new d.QAB},p.prototype._initializePrintIcons=function(a){a.on("click",function(a){a.preventDefault(),window.print()})},p.prototype._initializeRedemptionEvent=function(a){new i.RedemptionEvent(a)},p.prototype._initializeVideoPlayerMVC=function(a){new g.VideoPlayerMVC(a)},p.prototype._initializeImageTitleTag=function(){b("img").each(function(){var a=b(this).attr("alt");if(""===a||void 0===a)return!0;var c=b(this).attr("title");""!==c&&void 0!==c||b(this).attr("title",a)})},p.prototype._initializeFAQModal=function(a){new i.FAQModal(a)},p.prototype._initializeFAQ=function(a){new i.FAQ(a)},p.prototype._initializeUnsupportedBrowserWarning=function(a){new i.UnsupportedBrowserWarning(a)},p.prototype._initializeGeneralArticleSummaryListing=function(a){new i.GeneralArticleSummaryListing(a)},p.prototype._initializeAnchorsInPage=function(a){new i.AnchorsInPage(a)},p.prototype._initializeAccordionContentList=function(a){new g.AccordionContentList(a)},p.prototype._initializePharmacyServiceList=function(a,b){new g.PharmacyServiceList(a,b)},p.prototype._initializePharmacyServiceDetail=function(a,b){new g.PharmacyServiceDetail(a,b)},p.prototype._initializePromoBadge=function(a){new g.PromoBadge(a)},p.prototype._initializFlyer=function(a){new g.Flyer(a)},p.prototype._initializeContactUs=function(a){new g.ContactUs(a)},p.prototype._initializeOverlays=function(a){new g.Overlays(a)},p.prototype._initializeBrandDetails=function(){new g.BrandDetails},p.prototype._initializeMinorAilmentsList=function(a,b){new g.MinorAilmentsList(a,b)},p.prototype._initializePopUpManager=function(a){new i.PopUpManager(a)},p.prototype._initializeSocialShare=function(a){new i.SocialShare(a)},p.prototype._initializeCustomProductList=function(a){new g.CustomProductList.Controller(a)}}.call(this);